Xref: utzoo comp.theory:350 comp.misc:8230 comp.lang.misc:4141 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!mips!apple!apple.com!desnoyer From: desnoyer@apple.com (Peter Desnoyers) Newsgroups: comp.theory,comp.misc,comp.lang.misc Subject: Re: Modulus (Re: hashing function for strings) Message-ID: <6790@internal.Apple.COM> Date: 20 Feb 90 01:15:09 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 16 References:<1990Feb15.211210.22950@max.sunysb.edu> <0ZqzBRm00WA1M0d5JZ@andrew.cmu.edu> <7416@ogicse.ogc.edu> <10940@saturn.ADS.COM> <10946@saturn.ADS.COM> In article <10946@saturn.ADS.COM> xanthian@saturn.ADS.COM (Metafont Consultant Account) writes: > I see the idea of a modulus function that doesn't change if the axis > is shifted left or right by the mod base, rather than one that suffers > an ugly reflection at the origin, as inherently beautiful, in the math > sense. It is also inherently more useful, in the graphics programming > sense. It is more than just pretty. The integers mod M has M elements, usually represented as 0..M-1. A modulo operator that results in {integers mod M} having 2M-1 elements is either incorrectly named or incorrectly implemented. Peter Desnoyers Apple ATG desnoyer@apple.com