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-10 01:06:47 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!151.189.0.75!newsfeed.germany.net!newsfeed2.easynews.net!easynews.net!news.cid.net!news.enyo.de!news1.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Wraparound on multiply overflow Date: Fri, 10 Aug 2001 10:25:02 +0200 Organization: Enyo's not your organization Message-ID: <8766bw490h.fsf@deneb.enyo.de> References: <3B71AC13.F67BDC2@cadence.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:11745 Date: 2001-08-10T10:25:02+02:00 List-Id: Paul Graham writes: > 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. This is only true for unsigned types. > Can this code be written in Ada? Use a modular type. They correspond to unsigned types in C.