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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,df89b5458de26ba2 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Unsigned Longword Date: 1999/12/10 Message-ID: <3851ca05_3@news1.prserv.net>#1/1 X-Deja-AN: 559246571 Content-transfer-encoding: 7bit References: Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 11 Dec 1999 03:50:29 GMT, 129.37.62.147 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-10T00:00:00+00:00 List-Id: In article , Tom_Hargraves@Raytheon.com wrote: > Anyway, at the time I really wanted a 'true' 32 bit 'Unsigned Longword'. One > that went from 0..2**32-1, supported by associated +-/* operators. However, at > the time, both of the compilers (DEC and VADS) had System packages which > implemented unsigned longword as the Positive range of Integer, ie. > 0..2**31-1. (An understandable implementation on a twos complement machine). > Thus a '+' arithmetic operation which caused a result whose MSB was set to '1' > caused a constraint error. VADS had a package called Unsigned_Types (or something like that) that included true unsigned integers all the way up to and including 32 bits. When you with'd that package, this turned on compiler magic, effectively extending the language. > I'd like to ask this forum if there was/is a nicer way of implementing a > 'true' Unsigned Longword? You could try suppressing overflow on the type: type Unsigned_Integer is new Integer; pragma Suppress (Overflow_Check, On => Unsigned_Integer); -- The theory of evolution is quite rightly called the greatest unifying theory in biology. The diversity of organisms, similarities and differences between kinds of organisms, patterns of distribution and behavior, adaptation and interaction, all this was merely a bewildering chaos of facts until given meaning by the evolutionary theory. Populations, Species, and Evolution Ernst Mayr