Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!hofbauer From: hofbauer@utcsri.UUCP (John Hofbauer) Newsgroups: net.math,net.lang.c,net.arch Subject: Re: Integer division Message-ID: <2080@utcsri.UUCP> Date: Sun, 9-Feb-86 19:21:24 EST Article-I.D.: utcsri.2080 Posted: Sun Feb 9 19:21:24 1986 Date-Received: Sun, 9-Feb-86 19:42:33 EST References: <11603@ucbvax.BERKELEY.EDU> <4917@alice.UUCP> <367@mcgill-vision.UUCP> <685@brl-smoke.ARPA> Organization: CSRI, University of Toronto Lines: 16 > This % vs. Mod debate is rather silly. C's % operator is > NOT repeat NOT intended to be a modulo operator, although > people often use it that way for positive operands. All > reasonable mathematicians agree on what the definition of > a mod b > is for positive b and negative a. That should not be > confused with what the result of > a % b > should be under similar circumstances. C intentionally > hedges a bit on the meaning of % To paraphrase Alice In Wonderland loosely, an operator means whatever you want it to mean, nothing more, nothing less. The remainder of a machine integer division is defined as being whatever the engineer's found convenient to implement. Any resemblance to mathematics is purely coincidental.