On 9/2/2006 at 10:48 PM Don wrote:
No. The cheap calculator does fixed point math and
moves the
point accordingly.
Calculators call this a "floating decimal point". Just do a web search on
it.
And, "floating point" also deals with issues
that can't be
expressed in your calculator *or* scientific notation.
Notably, NaN's, gradual underflow, infinities (as well as
how infinities are treated), etc. Some implementations
support the concept of +0 and -0.
Just values called out that have predefined meanings. We could do the same
thing with my calculator-type math example by calling +/-9 999 999 999
"infinite" and +/-9 999 999 998 "NaN". If you express my little
calculator
as a exponent+mantissa model with an exponent range of 10^0 to 10^10, there
isn't a whole heckuva lot of difference--the range is the same. I would
submit that "scientific notation" begins where the exponent range exceeds
the number of significant digits in the mantissa.
On one's complement machines, like the CDC 6000/7000, not only do you have
+/- 0 in the (integers as well as "floating point"), but you also have +/-
infinite and +/- indefinite (what you moderns call NaN). There were
special cases when nonzero mantissae were present with any of the
"reserved" exponents.
The CDC did not implement an integer multiply instruction. However, it did
allow recovery of the lower 48 bits of a 48*48 bit floating point multiply
(it did not normalize the result). So, you just packed the upper 12 bits
of both integers with the equivalent of a zero exponent and did a
double-precision FP multiply. If you needed the high-order 48 bits, you
added an unnormalized single-precision multiply to recover it.
Likewise, there was no integer divide. The common dodge was to pack,
normalize and then FP divide, then unpack and shift the result--very slow
on the lower 6000. So, when a divide of an integer by a constant was
needed, you'd DP multiply by (2^47 / constant) +1 to get your quotient.
Cheers,
Chuck