comp.lang.ada
 help / color / mirror / Atom feed
From: jvl@ocsystems.com (Joel VanLaven)
Subject: Re: Question on modular types
Date: 1997/01/06
Date: 1997-01-06T00:00:00+00:00	[thread overview]
Message-ID: <1997Jan6.162846.37787@ocsystems.com> (raw)
In-Reply-To: 01bbfa96$66d516a0$8d2d5c8b@jerryware


  I think I know what the confusion is.  The problem is that -1 is not a
literal!  -1 is actually -(1).  1 is a perfectly valid uint and the "-"
operator is the modular "-" and so reduces the result back into the valid
range.  The problem really comes from the problem that we humans take -1
to be a literal but the language doesn't.  I have been confused by that
a few times myself, but in cases where it was more obvious what the problem
was (subtyping an integer type and then not finding the "-" operator).

-- 
-- Joel VanLaven




  parent 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
1997-01-08  0:00       ` Robert Dewar
1997-01-09  0:00         ` Tucker Taft
1997-01-11  0:00           ` Robert Dewar
1997-01-12  0:00             ` Joel VanLaven
1997-01-09  0:00         ` Robert A Duff
1997-01-06  0:00 ` Joel VanLaven [this message]
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