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,338371dbbe7075d X-Google-Attributes: gid103376,public From: kst@aonix.com (Keith Thompson) Subject: Re: [Q] Portability of <= and >= with real operands Date: 1996/12/03 Message-ID: #1/1 X-Deja-AN: 202075428 sender: news@thomsoft.com (USENET News Admin @flash) x-nntp-posting-host: pulsar references: <252531213wnr@diphi.demon.co.uk> organization: Thomson Software Products, San Diego, CA, USA newsgroups: comp.lang.ada originator: kst@pulsar Date: 1996-12-03T00:00:00+00:00 List-Id: In 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 <*> 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