Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

integer

🌌integer

integer -- abstract ancestor of integer numbers

integer is the abstract ancestor of integer numbers that provides operations
from numeric plus a devision remainder operation %, bitwise logical operations,
shift operations and gcd. Also, integers can be used to build fractions.

convert this to a number using the given base. If negative, add "-" as
the first character. Extend with leading "0" until the length is at
least len

convert this to a decimal number in a string. If negative, add "-" as
the first character.

redefines Object.asString:

convert this to a number using the given base. If negative, add "-" as
the first character.

create binary representation

create binary representation with given number of digits.

create decimal representation

create decimal representation with given number of digits.

§  gcd(b I)
 => 
I
:
Object

greatest common divisor of this and b

note that this assumes zero to be divisible by any positive integer.

create hexadecimal representation

create hexadecimal representation with given number of digits.

§  infix %(other I)
 => 
I
:
Object

division remainder
redefines numeric.infix %:
basic operations: 'infix %' (division remainder)

test divisibility by other

§  infix &(other I)
 => 
I
:
Object

bitwise operations

create a fraction

§  infix <<(other I)
 => 
I
:
Object

§  infix >>(other I)
 => 
I
:
Object

shift operations

§  infix ^(other I)
 => 
I
:
Object

§  infix |(other I)
 => 
I
:
Object

create a fraction via unicode fraction slash \u2044 '⁄ '

create octal representation

create octal representation with given number of digits.