comp.lang.ada
 help / color / mirror / Atom feed
From: kst@aonix.com (Keith Thompson)
Subject: Re: [Q] Portability of <= and >= with real operands
Date: 1996/12/03
Date: 1996-12-03T00:00:00+00:00	[thread overview]
Message-ID: <E1u0nL.L0I@thomsoft.com> (raw)
In-Reply-To: dewar.849320173@merv


In <dewar.849320173@merv> dewar@merv.cs.nyu.edu (Robert Dewar) writes:
[...]
> The idea that the use of <= is more portable than either < or =
> is particular rubbish, I see no possible justification for such a
> statement, and, unlike the old rule about avoiding equality, I cannot
> even guess the thought behind this misunderstanding.

Suppose you've computed two quantities, X and Y, such that X is
mathematically known to be less than Y, but it may be arbitrarily close.
Since floating-point is of finite precision, the representations of X
and Y may be equal.  (For example, X = 0.0, Y = some tiny value which
underflows to 0.0).  Then X <= Y may reflect the relationship more
accurately than X < Y.

Of course, in real life you should analyze the particular case, and you
may well reach the opposite conclusion, but I'd bet that the original
rationale for the statement was something like the above.

-- 
Keith Thompson (The_Other_Keith) kst@aonix.com <http://www.aonix.com> <*>
TeleSo^H^H^H^H^H^H Alsy^H^H^H^H Thomson Softw^H^H^H^H^H^H^H^H^H^H^H^H^H Aonix
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706
"SPOON!" -- The Tick




  reply	other threads:[~1996-12-03  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-29  0:00 [Q] Portability of <= and >= with real operands JP Thornley
1996-11-29  0:00 ` Robert Dewar
1996-12-03  0:00   ` Keith Thompson [this message]
1996-12-03  0:00     ` Robert Dewar
1996-12-03  0:00     ` Thomas Koenig
1996-12-03  0:00     ` Tucker Taft
1996-12-03  0:00       ` Larry Kilgallen
1996-12-03  0:00         ` Robert Dewar
1996-12-04  0:00       ` Keith Thompson
1996-12-01  0:00 ` Tucker Taft
1996-12-02  0:00   ` Norman H. Cohen
replies disabled

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