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,d9d2bccce5d4fc93 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: integer questia Date: Fri, 23 Apr 2010 12:01:35 +0200 Organization: Adalog Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 23 Apr 2010 10:01:42 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="Dn22F68J9CHYFQQlT81DGA"; logging-data="6571"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QKZC6iE/IfwRx2zruDV8J" User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) In-Reply-To: Cancel-Lock: sha1:a1GeWfI4uvBsbO43kKUl3poJHXQ= Xref: g2news2.google.com comp.lang.ada:11122 Date: 2010-04-23T12:01:35+02:00 List-Id: bedriemir a écrit : > what is the relation of root_integer , universal_integer and Integer > Root_Integer is an (anonymous!) type that includes all values acceptable by the implementation; i.e. its range is System.Min_Int..System.Max_Int. Conceptually, all integer types are derived from Root_Integer; i.e. if you write: type Age is range 0..125; it becomes for the compiler: type Age is new Root_Integer range 0..125; (LRM 3.5.4 (14)) Universal_Integer is more like the set of the mathematical integers; it is the type of integer literals, but any use of one of its values gets immediately converted to the expected type (this a slightly simplified model). (LRM 3.4.1 (6/2) Integer is just a predefined integer type, defined in package standard, with no special property. It is used to index strings, but safe for that, many projects forbid its use because it is not portable. Abuse of type Integer is generally an indication that the programmer has not been educated in defining proper types! A last word: a casual programmer does not need to care about root_integer and universal_integer. Leave that to lawyers! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr