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

f32

f32

f32 -- 32 bit floating point values


f32 are binary32-numbers as defined in the IEEE 754-2019 standard, see
https://ieeexplore.ieee.org/servlet/opac?punumber=8766227

Functions

comparision

redefines:


redefines:


redefines:


redefines:


redefines:

convert this to a string.

redefines:


redefines:


redefines:


redefines:


redefines:

basic operations: 'prefix -' (negation)

redefines:


redefines:


redefines:

conversion

redefines:

casting bit representation to u32
is the sign bit set?
the biased exponent
the normalized exponent

redefines:

the normalized mantissa

redefines:

the fraction of the floating point number

redefines:

true when the absolute value
is smaller than 0.001
or greater than 9_999_999

Type Features


redefines:


redefines:

§type.hash_code(a f32.this.type)
 => 
u64
:
Any 
create hash code from this number

special handling for floats:
although -0.0 and 0.0 are different in bit representation,
they are considered equal by both type.equality and IEEE
standard, hence they should have the same hash.
all NaNs are considered equal by type.equality (but not
the IEEE standard), so the hash of any NaN is the hash of
the "canonical" NaN.

redefines:

number of bits used for mantissa,
including leading '1' that is not actually stored
number of bits used for exponent
mask for the the bits that encode the mantissa
mask for the the bits that encode the exponent
(the mask is not shifted to the correct position)
the exponent bias (the zero offset of the exponent)
identity element for 'infix +'

redefines:

identity element for 'infix *'

redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:


redefines:

atan(y/x) with a few special cases
see also: https://go.dev/src/math/atan2.go

redefines:


redefines:


redefines:


redefines: