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,f127842852d2f03a X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: About conversions Date: 2000/11/23 Message-ID: #1/1 X-Deja-AN: 697039840 Sender: rusfw@mercury.rus.uni-stuttgart.de References: Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cert.uni-stuttgart.de X-Trace: hornet.rus.uni-stuttgart.de 974982674 9030 129.69.1.226 (23 Nov 2000 12:31:14 GMT) Organization: RUS-CERT, University of Stuttgart, Germany Mime-Version: 1.0 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 NNTP-Posting-Date: Thu, 23 Nov 2000 12:31:14 +0000 (UTC) Newsgroups: comp.lang.ada Date: 2000-11-23T00:00:00+00:00 List-Id: Wilhelm.Spickermann@t-online.de (Wilhelm Spickermann) writes: > On 23-Nov-00 Christoph Grein wrote: > > There's a common rule: ("Punkt vor Strich" in German) multiplication > > (* / mod > > rem) before addition (+ -), thus this is > > > > -14 mod 5 = -2**2 > > > > You wouldn't fall into the latter trap, would you? > > > > (Hope I'm correct, did not look it up in ARM :-) > > Sorry, but "mod x" always delivers values between 0 and x (x excluded). > So the result is 1 and not -4. -14 mod 5 is an unary_adding_operator followed by a term, consisting of an integer literal, a multiplying_operator and an integer literal. So Christoph is right. ;-)