FP Comparison and Denormalized Numbers
Floating-Point Comparison
IEEE 754 floating point numbers are ordered because
- Sign bit is most significant
⇒ quick test of signed ‘<’.
- Exponent value and its binary representation have same ordering because exponent uses a biased representation.
- Placing exponent before the fraction field orders the magnitude because
- Larger exponent
⇒ larger magnitude and
- For equal exponents, larger fraction
⇒ larger magnitude.
The IEEE 754 floating-point numbers have the following relationship:
0 < 0.F2×21-Bias < 1.F2×2E-Bias < ∞
Denormalized Numbers
IEEE standard uses denormalized numbers to
- Fill the gap between 0 and the smallest normalized float (
1.02×2-126), and
- Provide gradual underflow to zero.
Denormalized numbers are with exponent E=0 and fraction F≠0.
Implicit 1. before the fraction now becomes 0 (not normalized).
Value of denormalized number
(S,0,F) is as follows:
βIn fact, the mere act of opening the box will determine the state of the cat,
although in this case there were three determinate states the cat could be in:
these being Alive, Dead, and Bloody Furious.β
β Terry Pratchett, Lords and Ladies
|