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: 107079,c7637cfdf68e766 X-Google-Attributes: gid107079,public X-Google-Thread: 103376,c7637cfdf68e766 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,c7637cfdf68e766 X-Google-Attributes: gidf43e6,public X-Google-Thread: f8362,c7637cfdf68e766 X-Google-Attributes: gidf8362,public X-Google-Thread: 109d8a,c7637cfdf68e766 X-Google-Attributes: gid109d8a,public From: do_while@ridgecrest.ca.us (Do-While Jones) Subject: Re: floating point comparison Date: 1997/08/07 Message-ID: <5scin1$r10$1@owens.ridgecrest.ca.us>#1/1 X-Deja-AN: 262738489 Distribution: inet References: <33E214C3.311C@pseserv3.fw.hac.com> <33E61497.33E2@pseserv3.fw.hac.com> Organization: RidgeNet - SLIP/PPP Internet, Ridgecrest, CA. (619) 371-3501 Newsgroups: comp.lang.ada,sci.math.num-analysis,comp.software-eng,comp.theory,sci.math Date: 1997-08-07T00:00:00+00:00 List-Id: In article <33E61497.33E2@pseserv3.fw.hac.com>, W. Wesley Groleau x4923 wrote: [snip] >I understand floating point well enough to compute with pencil & >paper the correct bit pattern for Pi (3.14159.....) in a VAX >D_FLOAT, but I have never seen IEEE 754. Yet I almost always >treat floats "as if" they were "true" real numbers--and I have >NEVER had a bug traced to this "mistake". > >I've worked with a lot of decent programmers whose degrees are in >English, History, EE, ME, .... and most of them could say the same. >I KNOW some of my colleagues have no clue how floating point numbers >are represented, yet still manage to produce working code. > My degree is in EE, and my floating point code works because an enginner knows about uncertainty. When the sensor measures an angle to be 45.87 degrees, it might really be 45.87223 degrees. If an algorithm will work when the angle is 45.87 degrees, but not 45.87223 degrees, then the algorithm is worthless. Since the limitation of the floating-point representation is usually negligible compared to the measurement inaccuracy, we neglect floating-point representation errors. The protection we build in for measurement uncertainty also takes care of the floating-point representation resolution limitations. Do-While Jones +--------------------------------+ | Know Ada | | [Ada's Portrait] | | Will Travel | | wire do_while@ridgecrest.ca.us | +--------------------------------+