mn8 Language Reference | Index    

Integer

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  OPERATORS SUMMARY  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  OPERATOR DETAILS  METHOD DETAILS

Description

A lexical integer constant evaluates to a value of type integer. The internal representation of integers is 64-bit signed two's-complement. Overflows or underflow's during integer computations do not throw exceptions.

Usage

        Integer Expressions
            Expression        Value      Value Type
            ----------        -----      ----------
              1 + 2             3          Integer
              2*(7+1)           16         Integer
              4/2               2          Integer
              6%4               2          Integer

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Location:
Inherits: Concept, Real

Constructor List

create (String $value)
top

Operator List

Integer- (Integer $int)
Integer+ (Integer $int)
Integer--
Integer++
Integer* (Integer $int)
Real/ (Integer $int)
top

Method List

IntegerfromString (String $value)
Conceptabs
Conceptmax (Integer $value)
Conceptmin (Integer $value)
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI
Methods inherited from: Real
sqrt, toLogicalConcept, toStringConcept, abs, max, min, acos, asin, atan, ceil, cos, exp, floor, log, pow, sin, tan, toDegrees, toRadians

Detailed Constructor Info

create (String $value)
Parameters:
$value :A string concept.

Constructs an integer concept inicialized with the value represented by the string given as parameter.

top

Detailed Operator Info

- (Integer $int)
Parameters:
$int :Concept which value will be substracted from this concept.

Substracts the concept value given as parameter from this concept value and returns the result.

top
+ (Integer $int)
Parameters:
$int :Concept that will be added to this concept.

Adds the concept value given as parameter to this concept value and returns the result.

top
--

Decrease this concept value with 1.

top
++

Increase this concept value with 1.

top
* (Integer $int)
Parameters:
$int :Concept with which value will be multiplied this concept.

Multipy with the parameter value this concept value and returns the result.

top
/ (Integer $int)
Parameters:
$int :Concept with which value will be divided this concept.

Divide this concept value with the concept value given as parameter and returns the result.

top

Detailed Method Info

fromString (String $value)
Parameters:
$value :The string concept to be parsed.
Returns: Integer

Returns a newly constructed integer concept inicialized to the value represented by the string given as parameter.

            $int typeof Integer
            $int.fromString("123")
            print $int
            -- the result is --
            123
            

top
abs
Returns: Concept

Returns the absolute value of an integer concept. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned.

            $int = -12
            print $int.abs
            -- the result is --
            12
            

top
max (Integer $value)
Parameters:
$value :The integer concept to be compared to the current value
Returns: Concept

Returns the greater of two integer concepts. If the arguments have the same value, the result is that same value.

            $int = 2
            $test = -15
            print $int.max($test)
            -- the result is --
            2
            

top
min (Integer $value)
Parameters:
$value :The integer concept to be compared to the current value
Returns: Concept

Returns the smaller of two integer concepts. If the arguments have the same value, the result is that same value.

            $int = 2
            $test = -15
            print $int.min($test)
            -- the result is --
            -15
            

top