fp equality

roger schlafly uunet!gorn.echo.com!schlafly
Fri Nov 26 20:08:45 PST 1993


>> More to the point, some f.p. representations may be in registers and
>> some in RAM, and the number of bits of precision can differ depending
>> on which kind of storage has been allocated to the variable (or
>> intermediate result, in the midst of a computation).  I am told that
>> there are actual computers like this.  Thus, some bits can be "scraped
>> off" when a quantity represented in a register passes through a memory
>> "knothole", and naturally the skinny value may not compare equal to
>> the original wider value.
>> 
>> It amazes me that there are still people (not necessarily meaning RFG)
>> who think that comparing f.p. representations for exact equality is a
>> reasonable thing to be doing.
 
Then be amazed.  Some of us think an fp equality test is often a quite
reasonable thing to do.  If it doesn't work on your machine, complain
to your compiler vendor, because it works on nearly all the others.
The "knothole" problem you describe has little to do with the original
question.



More information about the Numeric-interest mailing list