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).