Xref: utzoo comp.lang.pascal:2877 alt.folklore.computers:998 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!sun-barr!newstop!sun!adapt!linden From: linden@adapt.Sun.COM (Peter van der Linden) Newsgroups: comp.lang.pascal,alt.folklore.computers Subject: Re: Problem in Turbo Pascal 4.0 Keywords: Nonterminating Repeat loop, real, representation Message-ID: <129838@sun.Eng.Sun.COM> Date: 3 Jan 90 19:01:18 GMT References: <4658@ur-cc.UUCP> <4660@ur-cc.UUCP> <803@tuewsd.lso.win.tue.nl> Sender: news@sun.Eng.Sun.COM Reply-To: linden@sun.UUCP (Peter van der Linden) Organization: Sun Microsystems, Mountain View Lines: 16 Kees Huizing - Eindhoven Univ of Techn - The Netherlands, wants to know: > the equality operator "=" does not (do) on reals what it pretends to do. > I accept that it cannot detect perfect equality of reals, but what it could do > is detect equality up to some representation dependent accuracy. > Why is it not done this way? A very reasonable question Kees! A number of years ago, a gentleman by the name of Dijkstra, located not a million miles from where you are, had the very same thought, and implemented it into an early Algol compiler. The experiment was soon deemed a failure when it was found that this had the inadvertent and unwanted side effect that comparison was no longer transitive. I.e. if A equalled B, and B equalled C, a program could not conclude that A = C ! ---------------- Disclaimer: I'm no Jack Kennedy, but I'm no Dan Quayle either. Peter van der Linden linden@SuN.cOm (415) 336-6206