🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.theory
Article #2066

Re: Modulus (Re: hashing function for strings)

#2066
From: Paul D. Crowley
Date: Mon, 19 Feb 1990 18:30
17 lines
1266 bytes
In article <E1wt*4@cs.psu.edu> flee@shire.cs.psu.edu (Felix Lee) writes:
>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.

I'd _hate_ a computer that obeyed the first of these. To me, -5 div 3 is
-2. -5 div 3 = int(-5/3) = int(-1.666) = -2

Then again, I think month and day numbers should start at 0.

-- 
 \/ o\ "I say we grease him right away. No offense." - Aliens.
 /\__/ Paul D Crowley aipdc@uk.ac.ed.castle
Technical Details
Message-ID: <2367@castle.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!aipdc
References: <1990Feb15.211210.22950@max.sunysb.edu> <0ZqzBRm00WA1M0d5JZ@andrew.cmu.edu> <7416@ogicse.ogc.edu> <10940@saturn.ADS.COM> <E1wt*4@cs.psu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!aipdc
From: aipdc@castle.ed.ac.uk (Paul D. Crowley)
Newsgroups: comp.theory,comp.misc,comp.lang.misc
Subject: Re: Modulus (Re: hashing function for strings)
Message-ID: <2367@castle.ed.ac.uk>
Date: 19 Feb 90 18:30:48 GMT
References: <1990Feb15.211210.22950@max.sunysb.edu> <0ZqzBRm00WA1M0d5JZ@andrew.cmu.edu> <7416@ogicse.ogc.edu> <10940@saturn.ADS.COM> <E1wt*4@cs.psu.edu>
Reply-To: aipdc@castle.ed.ac.uk (Paul D. Crowley)
Organization: Edinburgh University Computing Service
Lines: 17