Article View: comp.theory
Article #2063Modulus (Re: hashing function for strings)
From: Felix Lee
Date: Mon, 19 Feb 1990 06:57
Date: Mon, 19 Feb 1990 06:57
13 lines
1047 bytes
1047 bytes
Kent Paul Dolan <xanthian@ads.com> wrote: >Yep. It is utterly amazing how many modulus inplementations exist >where (-1) mod m isn't m-1. There are three things that most people would like: quotient = -5 div 3 = -(5 div 3) = -1 remainder = -5 mod 3 = (-5 + 6) mod 3 = 1 3*quotient + remainder = -5 Unfortunately, they're mutually contradictory. You must choose one of them to violate. Someone will be unhappy with your decision. -- Felix Lee flee@shire.cs.psu.edu *!psuvax1!flee
Technical Details
Message-ID:
<E1wt*4@cs.psu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!brutus.cs.uiuc.edu!psuvax1!newsReferences:
<1990Feb15.211210.22950@max.sunysb.edu> <0ZqzBRm00WA1M0d5JZ@andrew.cmu.edu> <7416@ogicse.ogc.edu> <10940@saturn.ADS.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!brutus.cs.uiuc.edu!psuvax1!news From: flee@shire.cs.psu.edu (Felix Lee) Newsgroups: comp.theory,comp.misc,comp.lang.misc Subject: Modulus (Re: hashing function for strings) Message-ID: <E1wt*4@cs.psu.edu> Date: 19 Feb 90 06:57:21 GMT References: <1990Feb15.211210.22950@max.sunysb.edu> <0ZqzBRm00WA1M0d5JZ@andrew.cmu.edu> <7416@ogicse.ogc.edu> <10940@saturn.ADS.COM> Sender: news@cs.psu.edu (Usenet) Organization: Penn State University Computer Science Lines: 13