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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.120.211 with SMTP id p202mr6451766itc.43.1519561858043; Sun, 25 Feb 2018 04:30:58 -0800 (PST) X-Received: by 10.157.11.165 with SMTP id 34mr66458oth.7.1519561857901; Sun, 25 Feb 2018 04:30:57 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!o66no1476806ita.0!news-out.google.com!a25ni505itj.0!nntp.google.com!o66no1476803ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 25 Feb 2018 04:30:57 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2001:470:9174:2:d11c:9c25:268f:5457; posting-account=r0RePAgAAABkc8iAou09Mtfbf-fnKQql NNTP-Posting-Host: 2001:470:9174:2:d11c:9c25:268f:5457 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: 64-bit unsigned integer? From: MM Injection-Date: Sun, 25 Feb 2018 12:30:58 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 1740 X-Received-Body-CRC: 4284248816 Xref: reader02.eternal-september.org comp.lang.ada:50631 Date: 2018-02-25T04:30:57-08:00 List-Id: Hi I'm trying to get an unsigned integer type of 64 bits without modular wraparound. On the GNAT that I have on my OSX, v7.1.0, I have experimented a bit, and can't get it right. I can declare the type type u64 is mod 2**64; -- this gives the range of numbers I want, but wraps if It overflows. I tried type u64 is range 0 .. 2**64-1; -- this fails with "integer type definition bounds out of range". Is there a way to do it so can get an unsigned integer that will raise an exception if it overflows? By preference, I'm looking for "simple" types (I hope that term is correct) rather than whole new classes. My terminology is heavily influenced by Python - apologies for its lack of accuracy in the Ada world. M --