| |||
Home > Floating-point support > Sample double precision floating-point values for IEEE 754 arithmetic |
Some sample double bit patterns, together with their mathematical values, are given in Table 25.
Table 25. Sample double-precision floating-point values
Double value | S | Exp | Frac | Mathematical value | Notes^{[a]} |
---|---|---|---|---|---|
0x3FF00000 00000000 | 0 | 0x3FF | 000...000 | 1.0 | - |
0xBFF00000 00000000 | 1 | 0x3FF | 000...000 | -1.0 | - |
0x3FF00000 00000001 | 0 | 0x3FF | 000...001 | 1.000 000 000 000 000 222 | a |
0x3FE80000 00000000 | 0 | 0x3FE | 100...000 | 0.75 | - |
0x00100000 00000000 | 0 | 0x001 | 000...000 | 2.23*10^{-308} | b |
0x00000000 00000001 | 0 | 0x000 | 000...001 | 4.94*10^{-324} | c |
0x7FEFFFFF FFFFFFFF | 0 | 0x7FE | 111...111 | 1.80*10^{308} | d |
0x7FF00000 00000000 | 0 | 0x7FF | 000...000 | Plus infinity | - |
0xFFF00000 00000000 | 1 | 0x7FF | 000...000 | Minus infinity | - |
0x00000000 00000000 | 0 | 0x000 | 000...000 | 0.0 | e |
0x7FF00000 00000001 | 0 | 0x7FF | 000...001 | Signaling NaN | f |
0x7FF80000 00000000 | 0 | 0x7FF | 100...000 | Quiet NaN | f |
^{[a] }See Notes on sample double precision floating-point values for more information. |
The smallest representable number that can be seen to be greater than 1.0. The amount that it differs from 1.0 is known as the machine epsilon. This is 0.000 000 119 in float, and 0.000 000 000 000 000 222 in double. The machine epsilon gives a rough idea of the number of significant figures the format can keep track of. float can do six or seven places. double can do fifteen or sixteen.
The smallest value that can be represented as a normalized number in each format. Numbers smaller than this can be stored as denormals, but are not held with as much precision.
The smallest positive number that can be distinguished from zero. This is the absolute lower limit of the format.
The largest finite number that can be stored. Attempting to increase this number by addition or multiplication causes overflow and generates infinity (in general).
Zero. Strictly speaking,
they show plus zero. Zero with a sign bit of 1, minus zero, is treated
differently by some operations, although the comparison operations
(for example ==
and !=
) report
that the two types of zero are equal.
There are two types of NaNs, signaling NaNs and quiet NaNs. Quiet NaNs have a 1 in the first bit of Frac, and signaling NaNs have a zero there. The difference is that signaling NaNs cause an exception when used, whereas quiet NaNs do not.
IEEE Standard for Floating-Point Arithmetic (IEEE 754), 1985 version