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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b6062cca52b2d096 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-01 08:35:20 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newspeer.radix.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Valid on QNaN generates exception, compiler bug? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3C5ABF5F.BBBAB407@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Fri, 1 Feb 2002 16:16:31 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:19490 Date: 2002-02-01T16:16:31+00:00 List-Id: Stephen Leake wrote: > > "Steve Doiel" writes: > > > In ObjectAda 7.2 (WinNT x86) I have found that if I assign a value of > > 16#FFC0_0000# (QNaN) to a 32 bit floating point value using unchecked > > conversion, then I try to check the value using 'VALID, I get a > > Constraint_Error, numeric overflow exception. > > > > Is this a compiler bug? > > No. "NaN" stands for "Not a Number". float_value'Valid checks to see > if 'float_value' holds a valid floating point number. It does not, so > Constraint_Error is raised. ARM 13.9.2 says "X'Valid is not considered to be a read of X; hence, it is not an error to check the validity of invalid data." The whole point of 'Valid is that it doesn't raise an exception regardless of the bit pattern stored in the object; otherwise it doesn't add anything to the language. -- Jeffrey Carter