3.2 Denormalized Numbers Why do we need denormalized numbers? Recall that, in Chapter 1, we observed that the floating-point numbers are not evenly distributed along the number line. They are densest near 0, and the size of the gaps between successive numbers increases exponentially as the exponent value increases . In the IEEE 754 standard, the base of the exponent is 2, and so the gaps double in size with each increment of the exponent value. The smallest positive normalized float value has
Then
and the significand is binary 1.00000000000000000000000. The value is
Without the denormalized numbers, the next smaller number is 0. When computing with extremely small numbers, this gap causes a "flush to zero." The largest possible denormalized float value has
and the significand is binary 0.11111111111111111111111. Its value is
So the largest possible denormalized float value is slightly less than the smallest positive normalized float value; since we already know that the smallest possible positive denormalized float value is approximately 1.4 x 10 - 45 , the denormalized values help fill in the gap between 0 and the smallest possible normalized float value. Thus, Java supports the more elegant "gradual underflow." As computed values get smaller and smaller, they become denormalized. Thus, instead of having the values abruptly flush to zero, there is a smoother approach to 0. |
Top |