Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site hoptoad.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!hoptoad!laura From: laura@hoptoad.uucp (Laura Creighton) Newsgroups: net.lang.c,net.lang Subject: Re: Integer division Message-ID: <484@hoptoad.uucp> Date: Tue, 4-Feb-86 09:21:22 EST Article-I.D.: hoptoad.484 Posted: Tue Feb 4 09:21:22 1986 Date-Received: Thu, 6-Feb-86 20:57:49 EST References: <332@ism780c.UUCP> <11603@ucbvax.BERKELEY.EDU> <11610@ucbvax.BERKELEY.EDU> <561@jplgodo.UUCP> <11689@ucbvax.BERKELEY.EDU> Reply-To: laura@hoptoad.UUCP (Laura Creighton) Distribution: net Organization: Nebula Consultants in San Francisco Lines: 40 Xref: watmath net.lang.c:7773 net.lang:2080 In article <11689@ucbvax.BERKELEY.EDU> weemba@brahms.UUCP (Matthew P. Wiener) writes: >.... There are several identities >running around that are incompatible. > > (1) a == (a/b) * b + a%b > (2) (-a)/b == -(a/b) > (3) (a+b)/b == a/b + 1 > (4) (a+b)%b == a%b > >Notice that (3) and (4) are compatible with what the number theorists want, >but (2) isn't. Sure the naive user is fooled by (2) under the version we >want, but then he's fooled by (3) and (4) in the usual version. (1) holds >when the / and % are both what the number theorist wants or when neither are >what the number theorist wants. While it is true that number theorists want 3 and 4, it is not the naive user who will be fooled by 2. It is the naive *mathematician*, which is just about everybody. To non-mathematicians, 2 is a law, with about the same force as the law of gravity, and not something that you can redefine. Sure they are wrong about the force of this law -- but blame the way mathematics is taught in hich schools and grade schools. In the meantime, only the mathematicians, as a class, will have the perspective to see this. Everybody else (again as a class) will look at (-a)/b != -(a/b) and say ***BUG!!!*** So, as a practical matter, the mathematicians will have to come up with a work-around, since only they are going to be able to understand what they want. In letting non-mathematicians design the languages they use, mathematicians may have seriously goofed, because the non-mathematicians may not understand what it is that the mathematicians want -- if they did they would be mathematicians. Of course, I am not sure that there is consensus among mathematicians as to what they want. If there is, maybe they should write their own language. [I'm glad I wrote that last line. It tells me where to post this fool thing, which has been in the back of my mind, bothering me, the whole time I was writing this. Before that, I was strongly tempted to post to net.philosophy...] -- Laura Creighton ihnp4!hoptoad!laura hoptoad!laura@lll-crg.arpa