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,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32c6d2fb891775fc,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-28 04:13:13 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Lars" Newsgroups: comp.lang.ada Subject: Modular integers Date: Tue, 28 Oct 2003 13:13:28 +0100 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1067343169 04 21343 NrpNVf1VSmHNVz 031028 12:12:49 X-Complaints-To: usenet-abuse@t-online.de X-ID: SPeJrrZHgeK2fj6Y00CFqmLZoYyrgp2TiOwLgx5FAEZDJpevjauYZR X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:1766 Date: 2003-10-28T13:13:28+01:00 List-Id: Hi, I was able to create an unsigned 64-bit integer using type unsigned_64_bit_integer is mod 2**64; Then I defined a subtype: subtype safe_unsigned_64_bit_integer is unsigned_64_bit_integer range 0 .. 2**64-1; When a variable of type unsigned_64_bit_integer contains 2**64-1 and you add 1, it is "reset" to 0, as expected. When a variable of type safe_unsigned_64_bit_integer contains 2**64-1 and you add 1, no exception is raised and it is "reset" to 0. Why is that? Shouldn't the compiler be able to insert a check that throws an exception if an overflow occurs? -Lars