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,f584bf624aabe591 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 12:12:04 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Signed integer to modular type conversion Date: 15 May 2002 12:12:03 -0700 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0205151112.4118648a@posting.google.com> References: NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1021489924 25677 127.0.0.1 (15 May 2002 19:12:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 May 2002 19:12:04 GMT Xref: archiver1.google.com comp.lang.ada:24116 Date: 2002-05-15T19:12:04+00:00 List-Id: adam@irvine.com (Adam Beneschan) wrote in message news:... > Am I missing something, or is Unchecked_Conversion (or > Pragma Suppress) really the only reasonable way to > accomplish this? Unless > I've forgotten something, it seems quite odd that Ada > provides modular types but does not provide a solution > for this (other than going through the "back door" by > using Unchecked_Conversion or Suppress). To me it seems quite appropriate to use UC here, since the meaning of this conversion is quite target dependent. For instance the unchecked conversion is only equivalent to mod 2 ** 32 on a 2's complement machine. On a 1's complement machine these are different and you need to be sure what you are requiring.