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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to check a Float for NaN Date: Fri, 23 May 2014 16:39:54 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <3132e38d-18bb-4890-9cec-31056ac6e3ba@x19g2000prg.googlegroups.com> <83ce619a-beef-447f-91ef-ff3dd68ff9df@googlegroups.com> <3tso4mcv80hk.8j7e1grtnha0$.dlg@40tude.net> <6c8f74c9-4b4e-47a0-90e0-efa1ecdd5e2e@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1401134684 11432 69.95.181.76 (26 May 2014 20:04:44 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 26 May 2014 20:04:44 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:20035 Date: 2014-05-23T16:39:54-05:00 List-Id: "Adam Beneschan" wrote in message news:b96fb365-9061-4170-8824-f68bab37f9dc@googlegroups.com... ... >> Why doesn't it preclude NaN returned and accepted by arithmetic >> operations? >> Either 3.5.7 lies or the operations do. > >I think it *does* preclude NaN, unless I don't understand what you mean. I >guess you could >say that the "operations lie", because if Machine_Overflows is False, an >operation on two >values of a floating-point type may have an invalid result. Right. I have no idea what's supposed to happen if Machine_Overflows is False. To the point that Janus/Ada simply doesn't use it; Machine_Overflows is True and we check after every group of operations to ensure that's true. So it's not possible to generate a NaN in Janus/Ada. I understand that the other semantics exists, but it's a mess by any standard and I'd need a lot more convincing ($$$$) to support something else. [That is, I see no sensible reason for NaNs or infinities -- they're just ways of deferring detection of bugs. I would have hoped that Ada's moved beyond that, just like it has for integers.] Randy.