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,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/05/01 Message-ID: #1/1 X-Deja-AN: 238689266 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335E0B1F.12C9@elca-matrix.ch> <335F5971.6375@elca-matrix.ch> <33671d9c.5046069@news.airmail.net> <3360BFA8.5A4A@elca-matrix.ch> <3365C5E0.57A1@elca-matrix.ch> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-01T00:00:00+00:00 List-Id: <", "<=" and "<=" that are just as good. Defining "good" here is tricky, e.g. you are not supposed to use "=" for floating point, but rather something like abs (a - b) < epsilon * (abs a + abs b)>> That is a common myth, particularly among those who do not do serious analysis of floating-point code. The equality operation for floating-point values is well defined, and is useful. The expression you give above with epsilon is sometimes useful (though dangerous because of intermediate overflow), but is a quite different operation. The notion that you should always use the epsilon approach is wrong. There are lots of examples of numerical algorithms where plain equality works fine (and is far more efficient), and there are cases of algorithms where ONLY the plain equality will work!