Integer

Top  Previous  Next

Integer

 

Represents integer numbers. Integer maps to JavaScript Number object and is therefore internally always represented as a floating-point number. The compiler will strive to keep the Number object with an integer value, though since Number is a double-precision float that value can exceed the 32 bits range and reach up to 54 bits for regular operands (+, -, <, etc.). Due to JavaScript limitations, value will be clamped to 32 bits for bitwise operands.

 

Integers can be represented in:

Decimal notation: 123, -456

Hexadecimal notation: $1AF or 0x1AF

Binary notation: 0b10011101

For formatting purposes, the underscore '_' character is accepted (and ignored) in Hexadecimal and Binary literals.

 

Methods

Conversions

ToString () : String //conversion to decimal string

ToHexString (digits : Integer) : String   //conversion to hexadecimal string

ToBin (digits : Integer) : String   // conversion to binary string

 

Maths

Factorial () : Float

IsPrime () : Boolean

LeastFactor () : Integer

Max (v2 : Integer) : Integer

Min (v2 : Integer) : Integer

Sign () : Integer

Sqr () : Integer

Unsigned32 () : Integer

Clamp (min : Integer; max : Integer) : Integer

 

 

 

Go to String object JS reference.

 

Go to Math object JS reference.

 

See more about TInteger