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-Thread: 103376,cd703a96ca51de6e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: 'Base Date: Thu, 8 Dec 2005 18:44:53 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1134055303.758950.308680@o13g2000cwo.googlegroups.com> <1134065313.469475.267400@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: host86-131-222-143.range86-131.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com 1134067493 24286 86.131.222.143 (8 Dec 2005 18:44:53 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Thu, 8 Dec 2005 18:44:53 +0000 (UTC) In-Reply-To: <1134065313.469475.267400@g47g2000cwa.googlegroups.com> X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) Xref: g2news1.google.com comp.lang.ada:6773 Date: 2005-12-08T18:44:53+00:00 List-Id: Matthew Heaney wrote: > T'Base refers to the "base range" of the type, which defines the range > in which intermediate calculations are performed. > > The standard states that the range of T'Base: > > (1) includes the value 0 > (2) is symmetric about zero, with possibly an extra negative value > (3) includes all of the values in the subtype T > > So for example, if T is: > > type T is 1 .. 42; > > then T'Base is > > type T'Base is -42 .. 42; > [snip] > I might have some of the details wrong, but that's the general idea. Sorry Matt - you must be ill or something as you're a wee bit "off base" with your answer to this one! Try this test prog to see what actually happens: with Ada.Text_IO; use Ada.Text_IO; procedure Test_Base is type T is range 1 .. 42; begin Put_Line (T'Base'Image (T'Base'First)); Put_Line (T'Base'Image (T'Base'Last)); end Test_Base; It isn't -42 .. 42 but the 'First .. 'Last or the underlying integer representation. In this case (with ObjectAda) -2147483648 to 2147483647. Cheers -- Martin