next up previous

2.6 Data Representations     continued...

Figure 2 illustrates the numbers that can be stored in a typical computer system with a floating point representation. The figure shows three disjoint regions: positive numbers , 0.0, and negative numbers . is the largest number that can be stored in the system; in the IEEE standard representation . is the smallest positive number, which is in the IEEE standard.

Programmers need to be aware of several important attributes of the floating point representation that are illustrated by this figure. The first is the magnitude of the range between and . There are about integers in this range. However there are only different 32-bit patterns. What this means is there are numbers in the range that do not have representations. Whenever a calculation results in one of these numbers, a round-off error will occur when the system approximates the result by the nearest (we hope) representable number. The arithmetic circuitry will produce a binary pattern that is close to the desired result, but not an exact representation. An interesting illustration of just how common these round-off errors are is the fact that 1 does not have a finite representation in binary, but is instead the infinitely repeating pattern .