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,XPRIO 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-01-30 20:04:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!wn2feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: "Steve Doiel" Newsgroups: comp.lang.ada Subject: Valid on QNaN generates exception, compiler bug? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1012449885 12.225.227.101 (Thu, 31 Jan 2002 04:04:45 GMT) NNTP-Posting-Date: Thu, 31 Jan 2002 04:04:45 GMT Organization: AT&T Broadband Date: Thu, 31 Jan 2002 04:04:45 GMT Xref: archiver1.google.com comp.lang.ada:19407 Date: 2002-01-31T04:04:45+00:00 List-Id: 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? To paraphrase FUNCTION Conv IS NEW Ada.Unchecked_Conversion( Unsigned_32, float ); ... float_value : Float; u32_value : Unsigned_Float; ... u32_value := 16#FFC0_0000#; float_value := Conv( u32_value ); IF float_value'VALID THEN -- The exception occurs on this line Text_Io.Put_Line( "Value is valid" ); ELSE Text_Io.Put_Line( "Value is not valid" ); END IF; BTW: Gnat 3.13p with -gnato does not raise an exception. Thanks, SteveD