Motivation for Floating Point

Force due to gravity at the earth's surface:

F = (G*M*m)/(r*r) (Halliday&Resnick, p. 387)

Where

So we get 6.67E-11 * 5.98E24 * 77 / (6.37E6 * 6.37E6) = 757 nt

Notice how we manipulated these numbers: rather than writing the mass of the earth as 59800000000000000000000 kg, we used ``scientific notation,'' in which a number is broken into two parts: an exponent and a mantissa. Trying to do the arithmetic as 32-bit integers would be (1) futile, because we don't have the range we need, and (2) overkill, because we have a lot more precision than we need.

The solution to these issues in computers is the same as that used by physicists: scientific notation. The difference is, where we use scientific notation with decimal numbers on paper, we use it with binary numbers in the computer. Also, we pack all three components of the number (sign, exponent, significand) into a single 32-bit word (or 64-bit word for double precision) rather than representing them as separate variables.


Last modified: Fri Jan 10 09:07:17 MST 2003