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,772ddcb41cd06d5b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: How to check a Float for NaN Reply-To: anon@anon.org (anon) References: <3132e38d-18bb-4890-9cec-31056ac6e3ba@x19g2000prg.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Fri, 09 May 2008 19:49:50 GMT NNTP-Posting-Host: 12.64.146.234 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1210362590 12.64.146.234 (Fri, 09 May 2008 19:49:50 GMT) NNTP-Posting-Date: Fri, 09 May 2008 19:49:50 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5756 Date: 2008-05-09T19:49:50+00:00 List-Id: -- -- Nan is define to be greater than value of hex 16#FF000000# -- function isNan ( N : Float ) return Boolean is T : Long_Long_Integer := Long_Long_Integer ( N ) ; begin if T > 16#FF000000# then return True ; else return False ; end if ; end ; In <3132e38d-18bb-4890-9cec-31056ac6e3ba@x19g2000prg.googlegroups.com>, Jerry writes: >How would one check a Float or Long_Float if it has value NaN? The >only ways that I can come up with are to import a C function (isnan, I >think) or to write Long_Float'image(Some_Float) to a string and >examine the first three characters to see if they are "NaN" (and that >seems to be a GNAT implementation choice so might not be portable, >which is OK for my use). > >Jerry >