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,6fb545e0f992d3a9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-09 09:23:41 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!kinglear.mobilixnet.dk!news1!newsfeed1.uni2.dk!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Wraparound on multiply overflow Date: Thu, 09 Aug 2001 18:23:40 +0200 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3B72B90C.FE5FC09B@nbi.dk> References: <3B71AC13.F67BDC2@cadence.com> NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.net.uni-c.dk 997374220 43242 130.225.212.55 (9 Aug 2001 16:23:40 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Thu, 9 Aug 2001 16:23:40 +0000 (UTC) X-Mailer: Mozilla 4.78 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: archiver1.google.com comp.lang.ada:11689 Date: 2001-08-09T18:23:40+02:00 List-Id: Paul: > In C it is defined that the result of multiplying two unsigned integers > is the mathematical result modulo the value (int_max + 1), where int_max > is the maximum unsigned integer. That kind of integers are called modular types in Ada. Have a look at 3.5.4(4) and 3.5.4(36) in the Ada Reference Manual (1995 edition). > I know that Ada has modular types, but these don't work with multiply, > do they? You might want to RTFM. 4.5.5(1): "The multiplying operators [...] are predefined for EVERY specific integer type T:" (my emphasis) and modular types are together with signed integer types classified as integer types. Jacob -- "You've got to build bypasses!"