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

uint

🌌uint

unsigned integer of arbitrary size, including zero
represented by its bit sequence

this uint as an i32

this uint as an u32


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

redefines Object.asString:

this uint as a string, may contain leading zeros

the actually relevant data of this uint.
irrelevant zeros at start are dropped.
zero is represented by the empty list.

divide with remainder the two given positive ints
returns the quotient and the remainder
NYI performance: https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/math/big/natdiv.go

return two sequences of equal length
by prepending zero(s) to the shorter sequence

the highest 1 bit in this integer
example: uint 0 => 0
example: uint 1 => 1
example: uint 8 => 4

modulo
returns the remainder of the division
redefines integer.infix %:
division remainder
redefines numeric.infix %:
basic operations: 'infix %' (division remainder)


redefines numeric.infix %!:

bitwise and
redefines integer.infix &:
bitwise operations

NYI make faster: https://en.wikipedia.org/wiki/Multiplication_algorithm#Computational_complexity_of_multiplication
multiply these unsigned ints
redefines numeric.infix *:
basic operations: 'infix *' (multiplication)


redefines numeric.infix *!:

exponentation operator:
this uint to the power of other
redefines numeric.infix **:
basic operations: 'infix **' (exponentiation)


redefines numeric.infix **!:


redefines numeric.infix **?:


redefines numeric.infix **^:

add two unsigned ints
redefines numeric.infix +:
basic operations: 'infix +' (addition)


redefines numeric.infix +!:

subtract other from this unsigned int
redefines numeric.infix -:
basic operations: 'infix -' (substraction)


redefines numeric.infix -!:

divide these unsigned ints
redefines numeric.infix /:
basic operations: 'infix /' (division)


redefines numeric.infix /!:

shift left
redefines integer.infix <<:

less or equal
redefines partiallyOrdered.infix <=:
does this come before other?

are these unsigned integers equal?
redefines numeric.infix ==:
comparison

shift right
redefines integer.infix >>:
shift operations

bitwise xor
redefines integer.infix ^:

bitwise or
redefines integer.infix |:


redefines numerics.one:
identity element for 'infix *'


redefines partiallyOrdered.orderedThis:
get value of type P.

NYI: #167: Once Eiffel-style 'like this' works, we can use 'like this' instead of
T and no longer need this feature.


redefines numeric.prefix -!:


redefines numeric.thiz:
get numeric.this value of type T. This is used for a generic implemention
of some features (e.g. prefix -, abs


redefines numerics.zero:
identity element for 'infix +'

return an array of length n
initialized with u32 zeros.