comp.lang.ada
 help / color / mirror / Atom feed
From: wlohmann@informatik.uni-rostock.de (Wolfgang Lohmann)
Subject: Re: Floating point problems in GNAT
Date: 1997/02/12
Date: 1997-02-12T00:00:00+00:00	[thread overview]
Message-ID: <5dt3n1$jnf@taiwan.informatik.uni-rostock.de> (raw)



[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) ..."





             reply	other threads:[~1997-02-12  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-12  0:00 Wolfgang Lohmann [this message]
     [not found] ` <E5KKo6.CKH@thomsoft.com>
     [not found]   ` <EACHUS.97Feb14115527@spectre.mitre.org>
1997-02-16  0:00     ` Floating point problems in GNAT Keith Thompson
1997-02-16  0:00       ` Robert Dewar
1997-02-19  0:00   ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox