comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Question on modular types
Date: 1997/01/06
Date: 1997-01-06T00:00:00+00:00	[thread overview]
Message-ID: <E3LotB.9J9@world.std.com> (raw)
In-Reply-To: 01bbfbf8$4fda7a40$5f2d5c8b@jerryware


In article <01bbfbf8$4fda7a40$5f2d5c8b@jerryware>,
Jerry van Dijk <jvandyk@ibm.net> 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




  reply	other threads:[~1997-01-06  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-04  0:00 Question on modular types Jerry van Dijk
1997-01-04  0:00 ` Robert Dewar
1997-01-06  0:00   ` Jerry van Dijk
1997-01-06  0:00     ` Robert A Duff [this message]
1997-01-08  0:00       ` Robert Dewar
1997-01-09  0:00         ` Robert A Duff
1997-01-09  0:00         ` Tucker Taft
1997-01-11  0:00           ` Robert Dewar
1997-01-12  0:00             ` Joel VanLaven
1997-01-06  0:00 ` Joel VanLaven
1997-01-08  0:00 ` Stan and/or Jill Grimes
replies disabled

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