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,3b4bed4f74b8ac49 X-Google-Attributes: gid103376,public From: "Norman H. Cohen" Subject: Re: GNAT messages and the not operator (pitfall alert!) Date: 1996/10/30 Message-ID: <327771EE.1237@watson.ibm.com>#1/1 X-Deja-AN: 193215894 references: <32762A30.D2D@watson.ibm.com> <1996Oct29.145959.1@corning.com> to: "whiting_ms@corning.com (Matt Whiting)" content-type: text/plain; charset=us-ascii organization: IBM Thomas J. Watson Research Center mime-version: 1.0 reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; I) Date: 1996-10-30T00:00:00+00:00 List-Id: whiting_ms@corning.com (Matt Whiting) wrote (referring to Figure 6.2 in Ada as a Second Language): > 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? You are indeed reading the table incorrectly. The entry to which you refer occurs in the row marked "X mod 4" in the column for X = -5. Thus it gives the value for (-5) mod 4, which is indeed 3, not the value of -(5 mod 4), which is, of course -1. (As you noted, "-5 mod 4" means, surprisingly, "-(5 mod 4)", so the table entry for X mod 4 when X = -5 is NOT the value of -5 mod 4.) -- Norman H. Cohen mailto:ncohen@watson.ibm.com http://www.research.ibm.com/people/n/ncohen