Article View: comp.theory
Article #2076Re: Modulus (Re: hashing function for strings)
From: Robert Firth
Date: Thu, 22 Feb 1990 13:37
Date: Thu, 22 Feb 1990 13:37
16 lines
1291 bytes
1291 bytes
In article <12099@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: [the 'contrary' view is that integer division should truncate towards zero] >Several others have told me that it 'depends on what you're doing', but so >far nobody has come up with an example where the contrary view is a win. That surprises me, since there is a standard example. You have a picture drawn on a Cartesian plane, symmetrical about the origin. You need to scale this picture by some factor - for example, you want to reduce its size by 50% linear. The obvious coordinate transformation is (x',y') = (x/2,y/2). If division truncates towards zero, fine; otherwise, the scaled picture is no longer symmetrical (and typically the viewer can perceive the asymmetry).
Technical Details
Message-ID:
<6197@bd.sei.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!rice!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!firthReferences:
<Er$cfg@cs.psu.edu> <12099@goofy.megatest.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!rice!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!firth From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.theory,comp.misc,comp.lang.misc Subject: Re: Modulus (Re: hashing function for strings) Message-ID: <6197@bd.sei.cmu.edu> Date: 22 Feb 90 13:37:33 GMT References: <Er$cfg@cs.psu.edu> <12099@goofy.megatest.UUCP> Reply-To: firth@sei.cmu.edu (Robert Firth) Organization: Software Engineering Institute, Pittsburgh, PA Lines: 16