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: 103376,486bed9a72d373b,start X-Google-Attributes: gid103376,public From: wlohmann@informatik.uni-rostock.de (Wolfgang Lohmann) Subject: Re: Floating point problems in GNAT Date: 1997/02/12 Message-ID: <5dt3n1$jnf@taiwan.informatik.uni-rostock.de>#1/1 X-Deja-AN: 218310186 Organization: University of Rostock Newsgroups: comp.lang.ada Date: 1997-02-12T00:00:00+00:00 List-Id: [was: Comparison of Values from My_Float is digit 8; for similar calculations with same values in different order led to unequality.] To give my salt to the soup: To check two or more Floatvalues on equality one normally introduces a constant, let's say Epsilon : My_Float := 0.00000001; which represents the minimal difference of your Floattypevalues at the last significant position. If the difference of the two paths is smaller than Epilon the paths are equal with respect to (in this case) 8 required significant digits. Thus 0.12345678_0999999999 and 0.12345678_1000000000 are equal, which is what I would expect (or am I wrong ?). The use of My_Float'First as Epsilon led to wrong results. Regards, Wolfgang N.B.: I learnt this lesson from "while not ( A_Float = B_Float) ..."