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: 109fba,dad65365cb2b3396 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,dad65365cb2b3396 X-Google-Attributes: gidfac41,public X-Google-Thread: 1014db,dad65365cb2b3396 X-Google-Attributes: gid1014db,public X-Google-Thread: 106c43,dad65365cb2b3396 X-Google-Attributes: gid106c43,public X-Google-Thread: 103376,dad65365cb2b3396 X-Google-Attributes: gid103376,public From: kst@thomsoft.com (Keith Thompson) Subject: Re: The disturbing myth of Eiffel portability Date: 1996/11/21 Message-ID: #1/1 X-Deja-AN: 197777736 sender: news@thomsoft.com (USENET News Admin @flash) x-nntp-posting-host: pulsar references: <3294e64b.74799475@news2.ibm.net> <56t1m4$nis@bcrkh13.bnr.ca> organization: Thomson Software Products, San Diego, CA, USA newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.object originator: kst@pulsar Date: 1996-11-21T00:00:00+00:00 List-Id: In dewar@merv.cs.nyu.edu (Robert Dewar) writes: > Kaz says > > > Any computer scientist worth his salt knows that floating point > > numbers are only approximations of real quantities. Well written > > numerical analysis code takes this into consideration, and can be > > made portable. [...] > Many computer scientists have this view of floating-point, but at least in > the IEEE world, this is an incorrect view. IEEE arithmetic is NOT an > approximation of real arithmetic, but rather an EXACT implementation of > a very well defined arithmetic, whose axioms are well understood. True, but that well defined arithmetic was designed to be an approximation of real arithmetic. > The idea that it is wrong to test for exact equality is quite incorrect, > there are many algorithms where it is perfectly legitimate to test for > exact equality if you know you are dealing with IEEE arithmetic. Agreed. It's important to remember, though, that the behavior of IEEE arithmetic can change depending on the current rounding mode, and the programmer may or may not have direct control over that. However, I don't think that affects any cases where it makes sense to test for exact equality. I believe the Ada specification of floating-point behavior is loose enough that an implementation can conform to it with any IEEE rounding mode. > This *huge* performance hit occurs on fewer and fewer machines, nearly all > machines now support IEEE arithmetic, and the decision to require this > semantis in Java represents a final nail in the coffin for weird (and often > badly designed) non-IEEE arithmetic systems. Any bets on whether Ada 200Y mandates (or at least strongly encourages) IEEE arithmetic? -- Keith Thompson (The_Other_Keith) kst@thomsoft.com <*> TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706 FIJAGDWOL