Path: utzoo!attcan!uunet!mailrus!iuvax!cica!tut.cis.ohio-state.edu!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.wizards Subject: Re: Floating Point Expectations Keywords: Double Precision Floating Point Message-ID: <12992@smoke.BRL.MIL> Date: 25 May 90 04:23:56 GMT References: <411@yonder.UUCP> <12977@smoke.BRL.MIL> <1990May24.132423.3080@eddie.mit.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 13 In article <1990May24.132423.3080@eddie.mit.edu> aryeh@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.