comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: Signed integer to modular type conversion
Date: 15 May 2002 12:12:03 -0700
Date: 2002-05-15T19:12:04+00:00	[thread overview]
Message-ID: <5ee5b646.0205151112.4118648a@posting.google.com> (raw)
In-Reply-To: b4682ab7.0205141853.7e835874@posting.google.com

adam@irvine.com (Adam Beneschan) wrote in message news:<b4682ab7.0205141853.7e835874@posting.google.com>...
> 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.



  parent reply	other threads:[~2002-05-15 19:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-15  2:53 Signed integer to modular type conversion Adam Beneschan
2002-05-15  3:34 ` Jim Rogers
2002-05-15 14:01 ` Mark Johnson
2002-05-16  0:02   ` Adam Beneschan
2002-05-16  2:26     ` Steven Deller
2002-05-16  9:53     ` Robert Dewar
2002-05-16 13:46       ` Steve Doiel
2002-05-16 14:00       ` Mark Johnson
2002-05-16 15:52       ` Adam Beneschan
2002-05-17  2:26         ` Robert Dewar
2002-05-17 16:44           ` Frank J. Lhota
2002-05-16 13:55     ` Mark Johnson
2002-05-15 19:12 ` Robert Dewar [this message]
2002-05-15 20:28 ` Adam Beneschan
  -- strict thread matches above, loose matches on Subject: below --
2002-05-15  5:43 Grein, Christoph
2002-05-16  4:39 Grein, Christoph
2002-05-16 14:13 ` Mark Johnson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox