From: whiting_ms@corning.com (whiting_ms@corning.com (Matt Whiting))
Subject: Re: GNAT messages and the not operator (pitfall alert!)
Date: 1996/10/30
Date: 1996-10-30T00:00:00+00:00 [thread overview]
Message-ID: <1996Oct30.073739.1@corning.com> (raw)
In-Reply-To: 01bbc5fe$823691c0$308371a5@dhoossr.iquest.com
In article <01bbc5fe$823691c0$308371a5@dhoossr.iquest.com>, "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> writes:
> whiting_ms@corning.com (Matt Whiting) wrote in article
> <1996Oct29.145959.1@corning.com>...
>>
>> Relative to the page 245 warning and the table on page 246, I'm still
> confused.
>> I'm probably beating a dead horse here, but something still doesn't seem
> right.
>> If I'm reading the p. 246 table correctly, -5 mod 4 (row 1, column 4,
>>excluding
>> the "header row and column"), should evaluate to 3. However, I just
>> wrote a
>> simple little program using ObjectAda V7.0 which evaluates to -1, which,
>> BTW,
>> is what I would have expected. Taking into account the warning on p.
>> 245, I
>> also tried -(5 mod 4). It does give the identical -1 result. Am I
>> reading the
>> table incorrectly?
>>
> -5 mod 4 = -(5 mod 4) = -1, but (-5) mod 4 = 3
>
> Is it clear now?
--
Yes, that is clear (and has been!), but the table on p. 246 of Ada as a Second
Language (2nd Edition), doesn't have parens around the first argument!
When I see X mod 4 and then see the column header have -5, I read that as
-5 mod 4, not as (-5) mod 4. I think the table could be more clear... :-)
Had the table read (X) mod 4...
Matt
next prev parent reply other threads:[~1996-10-30 0:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-10-24 0:00 GNAT messages and the not operator (pitfall alert!) Robert Dewar
1996-10-24 0:00 ` Robert Dewar
1996-10-25 0:00 ` whiting_ms@corning.com (Matt Whiting)
1996-10-26 0:00 ` David C. Hoos, Sr.
1996-10-27 0:00 ` Robert Dewar
1996-10-28 0:00 ` Matthew S. Whiting
1996-10-26 0:00 ` John Herro
1996-10-26 0:00 ` Robert Dewar
1996-10-29 0:00 ` John Herro
1996-10-29 0:00 ` Robert Dewar
1996-10-26 0:00 ` Matthew Heaney
1996-10-29 0:00 ` Robert Dewar
1996-10-30 0:00 ` Dr. Peter E. Obermayer
1996-10-30 0:00 ` John Herro
1996-10-30 0:00 ` Robert Dewar
1996-11-01 0:00 ` User Password expiration date extractor? Stein-Aksel Basma
1996-10-29 0:00 ` GNAT messages and the not operator (pitfall alert!) Norman H. Cohen
1996-10-29 0:00 ` whiting_ms@corning.com (Matt Whiting)
1996-10-30 0:00 ` Robert Dewar
1996-10-30 0:00 ` Norman H. Cohen
1996-11-06 0:00 ` Richard A. O'Keefe
1996-11-18 0:00 ` Norman H. Cohen
1996-11-18 0:00 ` Robert Dewar
1996-10-30 0:00 ` David C. Hoos, Sr.
1996-10-30 0:00 ` whiting_ms@corning.com (Matt Whiting) [this message]
1996-10-30 0:00 ` Norman H. Cohen
1996-11-05 0:00 ` Robert Dewar
1996-10-28 0:00 ` Cary Jamison
1996-10-29 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox