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: f43e6,c7637cfdf68e766 X-Google-Attributes: gidf43e6,public X-Google-Thread: 109d8a,c7637cfdf68e766 X-Google-Attributes: gid109d8a,public X-Google-Thread: 107079,c7637cfdf68e766 X-Google-Attributes: gid107079,public X-Google-Thread: 103376,c7637cfdf68e766 X-Google-Attributes: gid103376,public X-Google-Thread: f8362,c7637cfdf68e766 X-Google-Attributes: gidf8362,public From: jac@ibms48.scri.fsu.edu (Jim Carr) Subject: Re: floating point comparison Date: 1997/07/31 Message-ID: <5rq8mf$pfd$1@news.fsu.edu>#1/1 X-Deja-AN: 261069021 Distribution: inet References: Organization: Supercomputer Computations Research Institute Newsgroups: comp.lang.ada,sci.math.num-analysis,comp.software-eng,comp.theory,sci.math Date: 1997-07-31T00:00:00+00:00 List-Id: mheaney@ni.net (Matthew Heaney) writes: > >Why didn't he just say, "Compare them directly using the equality operator >for the floating point type." Why did he bother writing the Equal >function? Suppose the floating-point variable x is assigned the value of some floating-point constant. Would you want your program to return 'true' for the question "Is the sum from 1 to N of x, that is, $\sum_1^N x$ in TeX, equal to N times x?" for any valid floating-point constant and, say, values of N where the sum does not overflow? -- James A. Carr | Commercial e-mail is _NOT_ http://www.scri.fsu.edu/~jac/ | desired to this or any address Supercomputer Computations Res. Inst. | that resolves to my account Florida State, Tallahassee FL 32306 | for any reason at any time.