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: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: How to check a Float for NaN Date: Tue, 27 May 2014 15:59:07 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org 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> <840855a9-bda8-44b7-ab53-e157b4fc1d31@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 27 May 2014 22:59:10 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="2949cc1819e0726530893433d1436a1e"; logging-data="21607"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5cCEhkcKfQu+3c7YsMHdeAtzKpvCWLyw=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: Cancel-Lock: sha1:xYW2Ad5XXiBxxsemc5DCdpfN70g= X-Original-Bytes: 2474 Xref: number.nntp.dca.giganews.com comp.lang.ada:186674 Date: 2014-05-27T15:59:07-07:00 List-Id: On 05/27/2014 03:35 PM, Randy Brukardt wrote: > > I much prefer this sort of solution (where the missing values are explicitly > treated) rather than using some sort of magic number (a NaN being an extreme > version of that). The name alone tells you that it doesn't belong in a > numeric type -- since when is something that is "not a number" belong in a > type defining numbers? It's a clear violation of the software-engineering principle that a value has only a single meaning. (Of course, returning zero from Ada.Strings.Fixed.Index is the same error.) -- Jeff Carter "There's no messiah here. There's a mess all right, but no messiah." Monty Python's Life of Brian 84