From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d8a,c7637cfdf68e766 X-Google-Attributes: gid109d8a,public X-Google-Thread: f43e6,c7637cfdf68e766 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,c7637cfdf68e766 X-Google-Attributes: gid103376,public X-Google-Thread: f8362,c7637cfdf68e766 X-Google-Attributes: gidf8362,public X-Google-Thread: 107079,c7637cfdf68e766 X-Google-Attributes: gid107079,public From: christian.bau@isltd.insignia.comm (Christian Bau) Subject: Re: floating point comparison Date: 1997/08/08 Message-ID: #1/1 X-Deja-AN: 262829650 Sender: news@isltd.insignia.com (Usenet News) References: <33DF6F43.6EEA4806@digicomp.com> <5rqehs$g1r$1@odin.cc.pdx.edu> <33E11967.4A30@nr.net> <33E214C3.311C@pseserv3.fw.hac.com> <33E61497.33E2@pseserv3.fw.hac.com> <33E8DFF6.6F44@pseserv3.fw.hac.com> <33EA1251.3466@link.com> <33EA46CC.226@pseserv3.fw.hac.com> Organization: Insignia Solutions Newsgroups: comp.lang.ada,sci.math.num-analysis,comp.software-eng,comp.theory,sci.math Date: 1997-08-08T00:00:00+00:00 List-Id: In article <33EA46CC.226@pseserv3.fw.hac.com>, "W. Wesley Groleau x4923" wrote: > Well, the part about "((a-b) - a) + b can turn up as equal to b" > might use some clarification (as Chris L. Kuszmaul offered) for > some readers. And in fact, it might be expressed as a - b - c + d > where a & c are close in value and large, and b & d are close in > value but small. Because I always try to algebraically simplify > expressions, and "((a-b) - a) + b" would never appear in my code > unless a and b were functions that could change values between calls. One interesting case where you might use exactly the expression "((a-b) - a) + b": If you are using IEEE 754 arithmetic, and a >= b >= 0, then the expression ((a-b) - a) + b computes _exactly_ the rounding error made in computing a-b. -- For email responses, please remove the last emm from my address. -- For spams, please send them to whereever.you.want@but.not.here