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

wrappingInteger

🌌wrappingInteger

wrappingInteger -- abstract ancestor of wrap-around integer numbers

wrappingInteger is the abstract ancestor of integer numbers that have min and
max values and operations with wrap-around semantics.

redefines:

§  infix *(other W)
 => 
W
:
Any 
multiplication, with check for overflow

redefines:


redefines:

§  infix **(other W)
 => 
W
:
Any 
exponentiation for positive exponent

'zero ** zero' is permitted and results in 'one'.

redefines:


redefines:

exponentiation with overflow checking semantics

'zero **? zero' is permitted and results in 'one'.

redefines:

§  infix **^(other W)
 => 
W
:
Any 
exponentiation with saturating semantics

'zero **^ zero' is permitted and results in 'one'.

redefines:

§  infix **°(other W)
 => 
W
:
Any 
exponentiation with wrap-around semantics

'zero **° zero' is permitted and results in 'one'.

redefines:

§  infix *^(other W)
 => 
W
:
Any 

redefines:

§  infix *°(other W)
 => 
W
:
Any 
§  infix +(other W)
 => 
W
:
Any 
addition, with check for overflow

redefines:


redefines:


redefines:

§  infix +^(other W)
 => 
W
:
Any 

redefines:

§  infix +°(other W)
 => 
W
:
Any 
§  infix -(other W)
 => 
W
:
Any 
subtraction, with check for overflow

redefines:


redefines:


redefines:

§  infix -^(other W)
 => 
W
:
Any 

redefines:

§  infix -°(other W)
 => 
W
:
Any 

redefines:

check if this type of wrappingInteger is bounded

wrappingIntegers are assumed to be a bound set by default, so
this returns true unless redefined by an implementation

redefines:

would addition thiz + other cause an overflow or underflow?
would exponentiation 'this ** other' cause an overflow?
would multiplication thiz * other cause an overflow or underflow?
would subtraction thiz - other cause an overflow or underflow?
negation, with check for overflow

redefines:

preconditions used in 'numeric' for basic operations: true if the
operation is permitted for the given values

redefines:

overflow checking operations

redefines:

saturating operations

redefines:

neg, add, sub, mul with wrap-around semantics
bitwise NOT

redefines:

would negation -thiz cause an overflow?