E |
Values of Floating-Point Numbers
Use the following table to calculate the value of a
Exponent (e) | Mantissa (f) | Value of Floating Point Number |
|
|
|
|
|
|
255 | Not a valid number (NaN). | |
|
|
|
255 | 0 | |
0 < e < 255 | Any value | |
0 |
| |
0 | 0 | 0 |
|
|
|
f = the mantissa. The mantissa is a binary fraction.
e= the exponent. The exponent is an integer E such that E+127 is the power of 2 by which the mantissa must be multiplied to yield the
s | = | the sign bit. |
* | = | the multiplication operator. |
For example, consider the
01000001 01001000 00000000 00000000
or 41480000 hex in hexadecimal form. The most significant bit (the sign bit) is zero (s=0). The next eight most significant bits are 10000010, or 130 decimal (e=130).
The mantissa is stored as a decimal binary number with the decimal point preceding the most significant of the 23 bits. Thus, the most significant bit in the mantissa is a multiple of
1001000 00000000 00000000
The value of the mantissa, then, is .5625 (that is,
Since e > 0 and e < 255, we use the third formula in the table above:
number =
=
=1 * 23 * 1.5625
=8 * 1.5625
=12.5
Thus, you can see that the above binary representation is correct.
The range of numbers that can be stored in this format is from ±
± 3.402823E+38 and the number zero.
Series |