Article View: comp.theory
Article #2111Re: Modulus (Re: hashing function for strings)
From: Eliot Moss
Date: Mon, 26 Feb 1990 01:30
Date: Mon, 26 Feb 1990 01:30
23 lines
2031 bytes
2031 bytes
(Please take this as appropriately tongue-in-cheek, though there is a little bit of a message, too! :-) Ok, you theoretical weenies, the *real* reason why -5 DIV 2 comes out as -1 is that some of the first computers (including some of the first ones on which FORTRAN was implemented) were sign-magnitude machines ... so they implemented the MOD, DIV, etc. functions on the absolute values (magnitudes) and then propagated the signs according to (slightly arbitrary) rules. The FORTRAN standards were established in this distant era, have propagated to the present day, and continue to lead machine designers to implement the "FORTRAN" (sign/magnitude) version of these operations in hardware, even when language designers (such as myself) and algorithm designers probably prefer the purer "mathematical" form. The sign/magnitude form probably *is* a little easier to implement, but if it's not what people want, it doesn't matter. Of course, what people want depends on which people you ask .... Eliot -- J. Eliot B. Moss, Assistant Professor Department of Computer and Information Science Lederle Graduate Research Center University of Massachusetts Amherst, MA 01003 (413) 545-4206; Moss@cs.umass.edu
Technical Details
Message-ID:
<MOSS.90Feb25153020@ibis.cs.umass.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!bu.edu!mirror!frog!cpoint!jjmhome!m2c!umvlsi!dime!dime.cs.umass.edu!mossReferences:
<1990Feb15.211210.22950@max.sunysb.edu> <0ZqzBRm00WA1M0d5JZ@andrew.cmu.edu> <7416@ogicse.ogc.edu> <10940@saturn.ADS.COM> <E1wt*4@cs.psu.edu> <10946@saturn.ADS.COM> <6790@internal.Apple.COM> <10953@saturn.ADS.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!bu.edu!mirror!frog!cpoint!jjmhome!m2c!umvlsi!dime!dime.cs.umass.edu!moss From: moss@ibis.cs.umass.edu (Eliot Moss) Newsgroups: comp.theory,comp.misc,comp.lang.misc Subject: Re: Modulus (Re: hashing function for strings) Message-ID: <MOSS.90Feb25153020@ibis.cs.umass.edu> Date: 26 Feb 90 01:30:00 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> <10946@saturn.ADS.COM> <6790@internal.Apple.COM> <10953@saturn.ADS.COM> Sender: news@dime.cs.umass.edu Reply-To: Moss@cs.umass.edu Followup-To: comp.theory Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst) Lines: 23