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

integer

🌌integer

integer


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.

§asString(len i32, base u32)
 => 
string
:
Object

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.

the value corresponding to v in whatever integer implementation we have, maximum in case of overflow

§gcd(b T)
 => 
T
:
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.

§highest(b T)
 => 
T
:
Object

find the highest power of b that is less or equal than thiz.

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

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

test divisibility by other

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

bitwise operations

create a fraction

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

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

shift operations

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

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

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

create octal representation

create octal representation with given number of digits.

the constant '10' in whatever integer implementation we have, maximum in case of overflow

the u32 value corresponding to this

the constant '2' in whatever integer implementation we have, maximum in case of overflow