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-16 08:52:22 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: adam@irvine.com (Adam Beneschan) Newsgroups: comp.lang.ada Subject: Re: Signed integer to modular type conversion Date: 16 May 2002 08:52:22 -0700 Organization: http://groups.google.com/ Message-ID: References: <3CE26A21.3EC6F802@raytheon.com> <5ee5b646.0205160153.75230135@posting.google.com> NNTP-Posting-Host: 66.126.103.122 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1021564342 23045 127.0.0.1 (16 May 2002 15:52:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 16 May 2002 15:52:22 GMT Xref: archiver1.google.com comp.lang.ada:24208 Date: 2002-05-16T15:52:22+00:00 List-Id: dewar@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.0205160153.75230135@posting.google.com>... > adam@irvine.com (Adam Beneschan) wrote in message news:... > > > > 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