[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
more boring-to-most-people floating point stuff
- To: Moon@scrc-stony-brook.arpa
- Subject: more boring-to-most-people floating point stuff
- From: email@example.com (Richard Fateman)
- Date: Sun, 26 Jan 86 14:13:29 PST
- Cc: firstname.lastname@example.org
The example (/ (expt 10 68) 1.0e38) is illustrating
( <operator> <number-type-1> <number-type-2> ) whereas
(/ (* 1.0e34 1.0e34) 1.0e38) is illustrating (recursively)
(<operator> <number-type-1> <number-type-1>) .
Only when you combine two number types, one majorizing the other,
do you face this issue. The intent when combining different precisions
(and ranges) within floats is clear. You coerce to the longer precision
because it is likely to give you the right answer. Not the fastest.
A reasonable extension of this is if you mix floats with even longer
precision numbers (i.e., rational), you convert to rational, because it
gives you the right answer, not the fastest.
You can, of course, promote the notion that "anything goes" as soon as exact
and approximate numeric types are mixed, or claim that it would be too
costly to do the right thing.
To say this is the wrong forum for this is to
appear at odds with the space devoted to this
and other numeric data types in the language specification.