Hardware Reference
In-Depth Information
B
FLOATING-POINT NUMBERS
In many calculations the range of numbers used is very large. For example, a
calculation in astronomy might involve the mass of the electron, 9
10 −28 grams,
×
10 33 grams, a range exceeding 10 60 . These numbers
and the mass of the sun, 2
×
could be represented by
0000000000000000000000000000000000.0000000000000000000000000009
2000000000000000000000000000000000.0000000000000000000000000000
and all calculations could be carried out keeping 34 digits to the left of the decimal
point and 28 places to the right of it. Doing so would allow 62 significant digits in
the results. On a binary computer, multiple-precision arithmetic could be used to
provide enough significance. However, the mass of the sun is not even known
accurately to five significant digits, let alone 62. In fact few measurements of any
kind can (or need) be made accurately to 62 significant digits. Although it would
be possible to keep all intermediate results to 62 significant digits and then throw
away 50 or 60 of them before printing the final results, doing this is wasteful of
both CPU time and memory.
What is needed is a system for representing numbers in which the range of
expressible numbers is independent of the number of significant digits. In this
appendix, such a system will be discussed. It is based on the scientific notation
commonly used in physics, chemistry, and engineering.
681
 
 
Search WWH ::




Custom Search