Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!ucbvax!agate!wheatena!lippin From: lippin@wheatena.berkeley.edu (The Apathist) Newsgroups: comp.sys.mac.programmer Subject: Re: Severe Bug in SANE Package ? Message-ID: <21046@agate.BERKELEY.EDU> Date: 1 Mar 89 23:09:41 GMT References: <984@gmdzi.UUCP> Sender: usenet@agate.BERKELEY.EDU Reply-To: lippin@math.berkeley.edu Organization: Authorized Service, Incorporated Lines: 27 Recently roh@gmdzi.UUCP (Peter Rohleder ) wrote: > >It seems that we have found a severe bug in the Apples SANE-Package. > >We found it when we tried to figure out whether an EXTENDED has >digits unequal zero behind a predefined position after the decimalpoint. [...] >Is this really a severe bug in the SANE-Package or is there anything wrong >in our understanding of the precision of the different operations in SANE. I don't think this is really a bug; the problem lies in the necessary inaccuracy of applying the decimal concept of digits to the binary representations of SANE. In your relation test, you are (correctly) using a fudge factor in the check for equality, to avoid errors in the last few bits. However, you neglect to scale the fudge factor along with the numbers you are comparing, and so when you multiply by 10000, the errors in representation become greater than your saftey margin. I suspect, though I haven't tried it, that if you raise kDelta to 1E-14 your example program will work. --Tom Lippincott lippin@math.berkeley.edu "Thank you for observing all saftey precautions." --Dark Star