Information Technology Reference
In-Depth Information
Consider what is required to write the decimal number near 1000:
In decimal notation, we write 10 3 for 1000, using just beyond
3 decimal digits.
In binary notation, we write 2 10 for 1024, using just under 10
binary digits.
Thus, roughly speaking, what we can express in 10 binary digits,
we can express in 3 decimal digits. Extending this same idea further,
what we can express in 20 binary digits, we can express in 6 decimal
digits. Altogether, every three or four binary digits correspond
roughly to another decimal digit. Putting this together, 24 binary dig
its then express about the same level of numbers as 7 decimal digits.
Although the formal mathematics requires considerably more
analysis, this basic idea can be applied to show that the 23 bits of
singleprecision numbers correspond to about 7 decimal digits of ac
curacy, and the 52 bits of doubleprecision numbers correspond to
about 16 decimal digits of accuracy.
This discussion clearly has been somewhat technical, but the
main point is that storing real numbers allows only limited accuracy.
We may enter a number with 20 decimal places into a computer, but
only about 7 digits will be stored accurately if singleprecision num
bers are used behind the scenes. In case this seems of only abstract
significance, consider the following case study.
Example: Designing Aircraft
In the design of one company's aircraft, one step required the computation of the sine
of a 20digit number. In this computation, the normal approach is to subtract multi
ples of to obtain a result between 0 and 2 and then apply the sine function. In this
particular case, however, the computer used for the computation stored only 20 digits
of accuracy. Thus, after the initial subtraction, no digits of accuracy remained. The re
sult of the subtraction was completely meaningless; the sine function was applied to
an essentially random number, and the result was used to design aircraft.
Unfortunately, the engineers did not analyze this computation carefully for many years,
and instead felt confident in using the computed results in the design of the aircraft.
The serious implications of such mistakes could have been avoided by paying more
attention to the storage of these numbers and the nature of their computations.*
* From The Limits of Computing , p. 100. For more information, see Software
Engineering Notes , Volume 11, Number 5, October 1986, p. 9.
Search WWH ::




Custom Search