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,57d25404e12d2837,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-01 05:50:22 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-fra1.dfn.de!news.rwth-aachen.de!not-for-mail From: "Alexander Boucke" Newsgroups: comp.lang.ada Subject: How to catch NaNs with gnat3.14p Date: Fri, 1 Feb 2002 14:49:56 +0100 Organization: Lehr- und Forschungsgebiet f. Mechanik Message-ID: NNTP-Posting-Host: 134.130.177.111 X-Trace: nets3.rz.RWTH-Aachen.DE 1012571403 2685 134.130.177.111 (1 Feb 2002 13:50:03 GMT) X-Complaints-To: abuse@rwth-aachen.de NNTP-Posting-Date: 1 Feb 2002 13:50:03 GMT X-Newsreader: Microsoft Outlook Express Unix 5.00.2013.1312 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2013.1312 Xref: archiver1.google.com comp.lang.ada:19465 Date: 2002-02-01T13:50:03+00:00 List-Id: Hello! One of the announced features of gnat3.14p is the ability to raise contraint error, when NaN or Inf occures. But how to do it? I was not able to find something about this in the documentation. And the following program just behaves as with gnat3.13p: with ada.text_io; use ada.text_io; procedure nan is float1, float2 : float := 0.0; a_nan : float; begin a_nan := float1/float2; if not a_nan'valid then put_line("A NaN occured " & a_nan'img); else put_line(a_nan'img); end if; end nan; compiling (gnatmake -gnato nan) yields the output: > ./nan A NaN occured NaN******** > Did I miss something? Regards, Alexander