Floating Point Expectations

Doug Gwyn gwyn at smoke.BRL.MIL
Fri May 25 14:23:56 AEST 1990


In article <1990May24.132423.3080 at eddie.mit.edu> aryeh at eddie.MIT.EDU (Aryeh M. Weiss) writes:
>The moral of the story is, just don't do == between two FP numbers.
>Exactitude is simply unrealistic in floating point.

Although this is correct as far as it goes, you can still get into trouble.
To avoid trouble, you must first truly believe that floating-point
representations are APPROXIMATIONS to real numbers.  This mind set
will enable you to be suspicious of any algorithmic assumptions
that rely on mathematical properties of the real-number system
being true of floating-point representations.  Some such properties
ARE true for some implementations of floating point, but not ALL
such properties and not for ALL implementations.  Textbooks on
numerical methods in computation should be consulted for more details.



More information about the Comp.unix.wizards mailing list