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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c462e8ad74872a98 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Question on modular types Date: 1997/01/06 Message-ID: #1/1 X-Deja-AN: 208118612 references: <01bbfa96$66d516a0$8d2d5c8b@jerryware> <01bbfbf8$4fda7a40$5f2d5c8b@jerryware> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1997-01-06T00:00:00+00:00 List-Id: In article <01bbfbf8$4fda7a40$5f2d5c8b@jerryware>, Jerry van Dijk wrote: >However, 4.5.4(1) mentions that all unary adding operators have their >conventional >meaning, and since the note is not technically part of the standard, >that leaves >me wondering wat that 'conventional meaning; might be. And >'conventional' to whom ? Convention to those who have read the RM, and understand that arithmetic on modular types is always wrap-around arithmetic. ;-) We called them "modular", and not "unsigned", after all. If you just want nonnegative values, then "type T is range 0..2**8-1;" or some such thing is more likely what you want. The problem with *that*, of course, is that it doesn't work if the upper bound is higher than the upper bound of the largest *signed* integer type -- e.g. "type T is range 0..2**64-1;" will not work in GNAT. - Bob