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,245c84afd1e393ce X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: What about big integers in Ada 2005? Date: Sun, 02 Oct 2005 16:12:18 +0100 Organization: Pushface Message-ID: References: <1581461.uQ1jN63t33@linux1.krischik.com> <1614932.bCcW5lLfee@linux1.krischik.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1128265941 25062 62.49.19.209 (2 Oct 2005 15:12:21 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 2 Oct 2005 15:12:21 +0000 (UTC) Cancel-Lock: sha1:S8K8louuwn7RroozQQmq4YQPl7U= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:5342 Date: 2005-10-02T16:12:18+01:00 List-Id: Martin Krischik writes: > Brian May wrote: > >> Question (from writing a communications protocol with a high level >> programming language that turned out to a an extremely poor >> choice[1]): > > package Interfaces is > pragma Pure (Interfaces); > > type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1; > for Integer_8'Size use 8; > > type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1; > for Integer_16'Size use 16; > > type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1; > for Integer_32'Size use 32; > > type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1; > for Integer_64'Size use 64; > > type Unsigned_8 is mod 2 ** 8; > for Unsigned_8'Size use 8; > > type Unsigned_16 is mod 2 ** 16; > for Unsigned_16'Size use 16; > > type Unsigned_32 is mod 2 ** 32; > for Unsigned_32'Size use 32; > > type Unsigned_64 is mod 2 ** 64; > for Unsigned_64'Size use 64; This is GNAT. On the other hand, RM95 says package Interfaces is pragma Pure(Interfaces); type Integer_n is range -2**(n-1) .. 2**(n-1) - 1; --2's complement type Unsigned_n is mod 2**n; .. An implementation shall provide the following declarations in the visible part of package Interfaces: * Signed and modular integer types of n bits, if supported by the target architecture, for each n that is at least the size of a storage element and that is a factor of the word size. The names of these types are of the form Integer_n for the signed types, and Unsigned_n for the modular types;