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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9b4538cfeb0c3576 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder4.news.weretis.net!news-peer.in.tum.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Float conversion Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <9e669a3b-1013-4bd1-b372-5f7dfa46d083@f42g2000yqn.googlegroups.com> <1q5zc0ais535h$.1jqwfxhj9cflc$.dlg@40tude.net> <4c519968$0$6893$9b4e6d93@newsspool2.arcor-online.net> <1d1txn4x3r5xn.1trm4gx9n87gm$.dlg@40tude.net> <1jo4xj7cntwy1$.1ntf9smcka8vf$.dlg@40tude.net> <1d617940-d138-4b8c-a321-ed23b47431b8@x21g2000yqa.googlegroups.com> Date: Fri, 30 Jul 2010 10:43:20 +0200 Message-ID: <1naf3ekl5k916$.f7ugc92galdz$.dlg@40tude.net> NNTP-Posting-Date: 30 Jul 2010 10:43:20 CEST NNTP-Posting-Host: 48f53bc0.newsspool2.arcor-online.net X-Trace: DXC=J1Y`1f9N>=4d8Nb@@ZG@b=A9EHlD;3Yc24Fo<]lROoR18kF[6LHn;2LCV>7enW;^6ZC`4\`mfM[68DC3SKW: X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:12702 Date: 2010-07-30T10:43:20+02:00 List-Id: On Thu, 29 Jul 2010 18:30:06 -0700 (PDT), Phil Clayton wrote: > On Jul 29, 8:15�pm, "Dmitry A. Kazakov" > wrote: >> You should never use equality or inequality for floating-point types. > > Inequalities (<, <=, >, >=) are ok - I think you meant don't use 'not > equals' (which is still an equality operator). Yes I did, thanks for correction. > However, just because equality between floating point numbers is a > dubious concept and should be avoided, it does not mean e.g. "<" and > "<=" are simply interchangeable. Far from it. They are almost same. According to the extension principle: I1<=I2 T (true) if forall x in I1, forall y in I2 x<=y F (false) if forall x in I1, forall y in I2 not x<=y _|_ (undefined) otherwise I1