comp.lang.ada
 help / color / mirror / Atom feed
* How to catch NaNs with gnat3.14p
@ 2002-02-01 13:49 Alexander Boucke
  2002-02-01 14:18 ` Preben Randhol
  2002-02-01 20:22 ` Robert Dewar
  0 siblings, 2 replies; 19+ messages in thread
From: Alexander Boucke @ 2002-02-01 13:49 UTC (permalink / raw)


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





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2002-02-05  1:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 13:49 How to catch NaNs with gnat3.14p Alexander Boucke
2002-02-01 14:18 ` Preben Randhol
2002-02-01 14:37   ` Alexander Boucke
2002-02-01 14:55     ` Preben Randhol
2002-02-01 14:59       ` Alexander Boucke
2002-02-01 15:30         ` Preben Randhol
2002-02-01 16:10           ` Alexander Boucke
2002-02-01 16:10             ` Jeffrey Creem
2002-02-02  6:23               ` Robert Dewar
2002-02-02  6:21     ` Robert Dewar
2002-02-04  8:57       ` Alexander Boucke
2002-02-02  6:20   ` Robert Dewar
2002-02-02 12:49     ` Preben Randhol
2002-02-02 22:56       ` Robert Dewar
2002-02-01 20:22 ` Robert Dewar
2002-02-03 13:27   ` Marc A. Criley
2002-02-03 23:06     ` Robert Dewar
2002-02-04 13:05       ` Marc A. Criley
2002-02-05  1:06         ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox