comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey Creem" <jeff@thecreems.com>
Subject: Re: Simple program to find average of 3 numbers
Date: Fri, 04 Jul 2003 21:17:00 GMT
Date: 2003-07-04T21:17:00+00:00	[thread overview]
Message-ID: <g9mNa.36436$926.3783@sccrnsc03> (raw)
In-Reply-To: 1e3ht-ig4.ln1@beastie.ix.netcom.com

Remeber everyone. -gnato is your friend.


GNAT by default does not run with integer overflow checks enabled.

try again

gnatmake -f -gnato avg

Gets Constraint_Error on GNAT 3.15p under windows XP.



"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
news:1e3ht-ig4.ln1@beastie.ix.netcom.com...
> prashna fed this fish to the penguins on Friday 04 July 2003 02:28 am:
>
> >
> > O.K, I have changed line 12 to  AVG := (OBJ1+OBJ2+OBJ3)/3;
> > But still it giving constraint error!!! :((
>
>         What compiler, and what OS?
>
>
> ---- avg.adb, using GNAT 3.15p, Mandrake Linux 8.2
>
> procedure avg is
>
>         type ONE_TO_100 is range 1..100;
>
>         Obj1, Obj2, Obj3 : ONE_TO_100;
>         Avg : ONE_TO_100;
>
> begin
>         Obj1 := 70;
>         Obj2 := 70;
>         Obj3 := 70;
>
>         Avg := (Obj1 + Obj2 + Obj3) / 3;
> end avg;
>
> ----
> [wulfraed@beastie ada]$ gnatmake avg
> gcc -c avg.adb
> gnatbind -x avg.ali
> gnatlink avg.ali
>
> [wulfraed@beastie ada]$ ./avg
>
>         No error (no output either, but you didn't have any shown...
>
> -- 
>  > ============================================================== <
>  >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >      wulfraed@dm.net     |       Bestiaria Support Staff       <
>  > ============================================================== <
>  >        Bestiaria Home Page: http://www.beastie.dm.net/         <
>  >            Home Page: http://www.dm.net/~wulfraed/             <
>





  parent reply	other threads:[~2003-07-04 21:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04  5:01 Simple program to find average of 3 numbers prashna
2003-07-04  5:22 ` John R. Strohm
2003-07-04  5:34   ` Cephus�
2003-07-04  9:54     ` Tarjei T. Jensen
2003-07-05 17:49       ` Cephus�
2003-07-04  5:33 ` Robert I. Eachus
2003-07-04  8:37   ` Stuart Palin
2003-07-05 10:06     ` Preben Randhol
2003-07-04  5:39 ` tmoran
2003-07-04  9:28   ` prashna
2003-07-04 11:02     ` Stuart Palin
2003-07-04 16:20     ` Pascal Obry
2003-07-05  1:25       ` Robert I. Eachus
     [not found]     ` <1e3ht-ig4.ln1@beastie.ix.netcom.com>
2003-07-04 21:17       ` Jeffrey Creem [this message]
2003-07-05  5:07         ` Anders Wirzenius
2003-07-05 14:39 ` Marqmc5
2003-07-06  3:47 ` g_ak
2003-07-08  5:06   ` prashna
2003-07-09 15:25     ` Matthew Heaney
2003-07-09 21:38       ` Robert I. Eachus
2003-07-10 13:52         ` Matthew Heaney
2003-07-10 15:46           ` Robert I. Eachus
2003-07-11  0:56             ` Randy Brukardt
2003-07-11 21:54           ` Robert A Duff
2003-07-11 21:50         ` Robert A Duff
2003-07-11 23:32           ` Robert I. Eachus
2003-07-10  4:55       ` Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2003-07-09  6:24 christoph.grein
replies disabled

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