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=ham 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!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!208.49.83.146.MISMATCH!uns-out.usenetserver.com!news.usenetserver.com!pc02.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to check a Float for NaN References: <3132e38d-18bb-4890-9cec-31056ac6e3ba@x19g2000prg.googlegroups.com> <12227360.svS57WvVVs@linux1.krischik.com> <8ee4e946-786c-4faa-8c95-f9027083eb4b@p25g2000pri.googlegroups.com> <97217ff4-aaf3-41ed-986c-8b6c0954e112@l28g2000prd.googlegroups.com> <4820a758$0$548$58c7af7e@news.kabelfoon.nl> <95c1de75-7aa0-4f00-bbc4-6f503a3c7aef@b9g2000prh.googlegroups.com> From: Stephen Leake Date: Fri, 09 May 2008 03:24:21 -0400 Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:f8W03zVUeLjSkZCiK4gw6tBFlCI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 57d514823f7d1e05e48ed07654 Xref: g2news2.google.com comp.lang.ada:5753 Date: 2008-05-09T03:24:21-04:00 List-Id: "Randy Brukardt" writes: > "Adam Beneschan" wrote in message > news:95c1de75-7aa0-4f00-bbc4-6f503a3c7aef@b9g2000prh.googlegroups.com... > ... >> type Ieee_Short_Real is >> record >> Mantissa_Sign : Mantissa_Sign_Type; >> Exponent : Exponent_Type; >> Mantissa : Mantissa_Type; >> end record; >> >> (I've omitted the rep clause because I think the one above might work >> only for big-endian and not little-endian machines or vice versa, and >> I don't feel like figuring it out because I have a cold and my head >> hurts enough already.) > > Sorry about the cold, but if you omit the rep. clause, all of these > components are likely to take full bytes and that won't work at all. > > IF you had given size clauses on all of the modular types AND a pragma Pack > on the record, it MIGHT have worked. But given that you need a particular > representation, omitting the rep. clause is irrational. (That said, getting > it right on both big-endian and little-endian machines is enough to make my > head explode. But it's rarely necessary, and certainly isn't in the OP's > case.) Ada 2005 supports endian-independent rep clauses; LRM 13.5.3 9/2. However, GNAT doesn't support them for anything bigger than 1 byte. I don't know about other compilers. -- -- Stephe