comp.lang.ada
 help / color / mirror / Atom feed
From: arnold@nospam.com (Stephen Arnold)
Subject: Numerical exceptions not raised properly?
Date: 1999/11/01
Date: 1999-11-01T00:00:00+00:00	[thread overview]
Message-ID: <7vkgnl$u5@chronicle.concentric.net> (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




             reply	other threads:[~1999-11-01  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-01  0:00 Stephen Arnold [this message]
1999-11-01  0:00 ` Numerical exceptions not raised properly? tmoran
1999-11-01  0:00   ` Stephen Arnold
1999-11-02  0:00 ` Robert Dewar
1999-11-04  0:00   ` Stephen Arnold
replies disabled

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