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,30e0ceaf4e6be70c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-11 14:55:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Simple program to find average of 3 numbers Date: 11 Jul 2003 17:54:56 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <6ZMNa.109291$0B.2183354@wagner.videotron.net> <1ec946d1.0307090725.73f5f200@posting.google.com> <3F0C8B45.2080108@attbi.com> <1ec946d1.0307100552.3fb220ac@posting.google.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1057960496 2335 199.172.62.241 (11 Jul 2003 21:54:56 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 11 Jul 2003 21:54:56 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:40213 Date: 2003-07-11T17:54:56-04:00 List-Id: mheaney@on2.com (Matthew Heaney) writes: > But the question is: what is the base range of the "implementation > defined integer type"? For declarations of this style: > > type T is new Integer range 1 .. 100; > > can was assume that the base range of the type includes all the values > in Integer'Base, Yes. >... or only the values in the range -100 .. 100? > > With respect to the base range of the type, how do the declarations > > type T is new Integer range 1 .. 100; Base range is at least Integer'First..Integer'Last, which is at least the 16-bit range. > type T is range 1 .. 100; Base range is at least -100..100. > differ from one another? The above is according to the RM. These are minimal ranges. Compilers can choose wider base ranges, and for any particular expression, the compiler is always allowed to get the right answer even if it is outside the base range. Base ranges give you a minimal range for intermediate results, guaranteed not to overflow. - Bob