comp.lang.ada
 help / color / mirror / Atom feed
* 64-bit unsigned integer?
@ 2018-02-25 12:30 MM
  2018-02-25 12:41 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: MM @ 2018-02-25 12:30 UTC (permalink / raw)


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
-- 

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2018-03-01 23:50 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-25 12:30 64-bit unsigned integer? MM
2018-02-25 12:41 ` Dmitry A. Kazakov
2018-02-25 12:54   ` MM
2018-02-25 13:23     ` Dmitry A. Kazakov
2018-02-25 13:59       ` MM
2018-02-25 14:20         ` Dmitry A. Kazakov
2018-02-25 15:34           ` MM
2018-02-25 16:35     ` Jeffrey R. Carter
2018-02-25 16:36 ` Anh Vo
2018-02-25 17:31   ` MM
2018-02-26 23:19     ` Randy Brukardt
2018-02-26 23:33       ` MM
2018-02-28 10:17       ` Paul Rubin
2018-02-28 10:39         ` J-P. Rosen
2018-02-28 10:59           ` Dmitry A. Kazakov
2018-02-28 23:20         ` Randy Brukardt
2018-03-01  5:47           ` Paul Rubin
2018-03-01  8:16             ` Niklas Holsti
2018-03-01  8:35               ` Simon Wright
2018-03-01  8:47               ` Dmitry A. Kazakov
2018-03-01 18:15                 ` Dan'l Miller
2018-03-01 19:10                   ` Dmitry A. Kazakov
2018-03-01 19:22                     ` Dan'l Miller
2018-03-01 19:59                       ` Dmitry A. Kazakov
2018-03-01 20:32                         ` Dan'l Miller
2018-03-01 21:15                           ` Dmitry A. Kazakov
2018-03-01 22:23                             ` Randy Brukardt
2018-03-01 23:50                             ` Robert Eachus
2018-03-01 20:06                     ` Niklas Holsti
2018-03-01 22:04               ` Randy Brukardt
2018-02-26  6:45 ` Robert Eachus
2018-02-27 16:40   ` Dan'l Miller
2018-02-27 17:18     ` J-P. Rosen
2018-02-27 18:17       ` Dan'l Miller
2018-02-28  3:03         ` Robert Eachus
2018-02-28  6:41         ` J-P. Rosen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox