**gill** (07/29/82)

I just read Berry's item saying the the mod joke was wrong but that 60 mod 20 = 3, not 30. I promised myself never to write this phrase again, but I can't help it. * S I G H * As far as I know, there are two general meanings to the word "modulus." One is used when talking about groups, the other when doing division in computers (i.e. as an operator) or (gasp!) by hand. In the first context, we can create a modulus number system with n elements labeled 0 through n-1 with bars on top to signify that each "number" stands for a partition of the integers (i.e. an equivalence class). Thus, the integers 0, 20, 40, 60, etc ... would all be equivalent to 0 (bar) mod 20. In the computer or division context (i.e. the C "%" operator), the idea is "remainder when dividing." For example, 13 mod 10 = 3 and -13 mod 10 = -3 (it would be equivalent to +7 in real mathematics). To find out what "number" an integer is really equivalent to in C, you must say n % MOD + (n < 0 ? MOD : 0) [assuming % costs more to do than +] or, if you know n goes no lower than 1 - MOD, (n + MOD) % MOD will do. If MOD is a power of two, you can cheat by using n & (MOD - 1). No matter what method is used, 60 mod 20 is (or is equivalent) to ZERO (or 0 bar). NOT 30. NOT 3. Perhaps as someone else pointed out if 60 were taken in base ten then 30 would be the same number in base 20 if lefthand juxtaposition meant increasing powers of 20. Sounds far fetched to me, but that's probably what was indended. Anyway, 3 is nothing more than the floor of dividing 60 by 20. So what? Well, at least the original joke was better than the repulsive one about M.I.T. "girls" (I prefer to call them women). Perhaps if it had said something about a kernal named bertie and his girlfriend named gertie, and how mod 20 there ages were same, it would have worked. Gill Pratt ...alice!gill OR gill@mc p.s. This points something else out. How about some debate on the bookeeping of followup articles? Perhaps there should be some sort of indication of whether other people have responded to a particular article when you first encounter it. This will at least save some face and also (I believe) a lot of traffic from repetitive answers.

**berry@sri-unix** (08/01/82)

Yes, Gill Pratt and everyone else who wrote to me to correct my egrtegious (make that egregious) error are correct: 60 mod 20 == 0. Mea maxima culpa. Please, no more mail about it! The only defense I can offer is that at the time I sent the reply, I was rather upset by the fact that my wife was about to give birth to our first child. Well, now I am even worse, since she is STILL about to give birth. AAUUGGH! So give me a break, folks. No more mail about my momentary lapse, please? (I would like to mention that everyone who did remind me of my error were approximately polite about it.) --Berry Kercheval Zehntel Inc.