From: adam@irvine.com (Adam Beneschan)
Subject: Re: Signed integer to modular type conversion
Date: 16 May 2002 08:52:22 -0700
Date: 2002-05-16T15:52:22+00:00 [thread overview]
Message-ID: <b4682ab7.0205160752.3f973bcc@posting.google.com> (raw)
In-Reply-To: 5ee5b646.0205160153.75230135@posting.google.com
dewar@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.0205160153.75230135@posting.google.com>...
> adam@irvine.com (Adam Beneschan) wrote in message news:<b4682ab7.0205151602.3c564c9e@posting.google.com>...
>
>
> > Would you still use something like Z := X + ToModType(Y) [where
> > ToModType is an instance of Unchecked_Conversion]?
>
> No, I would use a 64-bit type to compute. If you have a deficient
> compiler that does not support 64-bit integers, then you have trouble,
> but so what? You could have equally asked to deal with numbers in the
> range 2**44, and then you would have needed a larger type anyway.
>
> These days, all compilers should support 64-bit integers.
If the compiler supports 64-bit integers, then change my question so
that I have a number in the range 0..2**64-1 and a number in the range
-2**63 to 2**63-1 and wish to add them. Now my question still stands.
(Unless you want to answer by saying that these days all compilers
should support 128-bit integers.)
-- Adam
next prev parent reply other threads:[~2002-05-16 15:52 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 [this message]
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
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