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

numeric

numeric

numeric -- parent of all numeric features
this numeric value as an u8
is this part of given set

NYI: infix operators currently always use dynamic binding on the lhs and pass
the rhs as an argument. If we would support an 'rinfix ∈' that would use the
rhs for dynamic binding and the lhs as argument, we could define '∈' in Set T
and it would work for all set types.
§infix %(other T)
 => 
T
:
Any 
basic operations: 'infix %' (division remainder)
§infix %!(other T)
 => 
bool
:
Any 
§infix *(other T)
 => 
T
:
Any 
basic operations: 'infix *' (multiplication)
§infix *!(other T)
 => 
bool
:
Any 
§infix **(other T)
 => 
T
:
Any 
basic operations: 'infix **' (exponentiation)
§infix **^(other T)
 => 
T
:
Any 
§infix *^(other T)
 => 
T
:
Any 
§infix +(other T)
 => 
T
:
Any 
basic operations: 'infix +' (addition)
§infix +!(other T)
 => 
bool
:
Any 
§infix +^(other T)
 => 
T
:
Any 
§infix -(other T)
 => 
T
:
Any 
basic operations: 'infix -' (subtraction)
§infix -!(other T)
 => 
bool
:
Any 
§infix -^(other T)
 => 
T
:
Any 
§infix /(other T)
 => 
T
:
Any 
basic operations: 'infix /' (division)
§infix /!(other T)
 => 
bool
:
Any 
is this not part of given set
basic operations: 'prefix +' (identity)
preconditions for basic operations: true if the operation's result is
representable for the given values

This does not check if the operation is defined (i.e, it
returns true for '3/!0' or '0**!0'.
basic operations: 'prefix -' (negation)
overflow checking operations
saturating operations
get numeric.this value of type T. This is used for a generic implemention
of some features (e.g. prefix -, abs)
the u32 value corresponding to this
note: potential fraction will be discarded
NYI replace this by as_u32?