Contents Up Previous Next

Floating point values

The IEEE ,,Standard for Binary Floating-Point Arithmetic'' (IEEE 754) was developed in the early 1980s in order to cater for consistent floating point representation in different computer architectures. If parameters are sent as floating point numbers to/from the modules, this standard applies. A floating point number is thereby represented as a 32-bit value.

Plus/minus sign bit Exponent Mantissa (standardized)
1 bit (bit 32) 8 bit (bit 23.. bit 30) 23 bit (bit 1.. bit 22)
s e f

As the mantissa is always set to "1", only the decimals are stored, as the leading "1" does not need to be recorded. A floating point value can thus be calculated as follows:

(-1)^(s)*2^(e-127)*(1.f)(bin)
Examples:

Sign Exponent Mantissa
1 bit 8 bit 23 bit
7/4 0 01111111 11000000000000000000000
-34.432175 1 10000100 00010011011101010001100
-959818 1 10010010 11010100101010010100000
+0 0 00000000 00000000000000000000000
-0 1 00000000 00000000000000000000000
2^(-126), or 1.175*10^(-38)
Smallest positive number 0 00000001 00000000000000000000000
(2-2^(-23)) 2^(127), or 3.403*10^(38)
Largest positive number 0 11111110 11111111111111111111111
infinite 0 11111111 11111111111111111111111
NaN 0 11111111 not all ,,0'' or ,,1''
Macheps 2^(-23), oder 1.192*10^(-7)
Smallest distinct number 0 01101000 00000000000000000000000
2^(-128) 0 00000000 01000000000000000000000