comp.lang.ada
 help / color / mirror / Atom feed
* Numerical exceptions not raised properly?
@ 1999-11-01  0:00 Stephen Arnold
  1999-11-01  0:00 ` tmoran
  1999-11-02  0:00 ` Robert Dewar
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Arnold @ 1999-11-01  0:00 UTC (permalink / raw)


Howdy folks:

I'm pretty new to Ada, as well as GNAT, so this could be due to my own 
ignorance (rather than a GNAT problem), but it seems that certain 
exceptions are not being raised properly.

Setup:  Win95b with latest GNAT 3.12p package.

When I compile and run some simple code (I'm doing the Lovelace 
tutorial):

with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;

procedure Compute is

 procedure Double(Item : in out Integer) is
 begin -- procedure Double.
   Item := Item + 2;
 end Double;

 X : Integer := 1;   -- Local variable X of type Integer.

begin -- procedure Compute
 loop
  Put_Line("X = ");
  Put(X);
  New_Line;
  Double(X);
 end loop;
end Compute;

It doesn't seem to raise an exception when X gets too big (ie, you can 
see it wrap negative, then it goes to zero and stays there).  When I try 
dividing by zero, the exception is raised correctly.

Is there something I'm missing, or?

Thanks in advance, Steve Arnold




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

end of thread, other threads:[~1999-11-04  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-01  0:00 Numerical exceptions not raised properly? Stephen Arnold
1999-11-01  0:00 ` tmoran
1999-11-01  0:00   ` Stephen Arnold
1999-11-02  0:00 ` Robert Dewar
1999-11-04  0:00   ` Stephen Arnold

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