🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.theory
Article #2069

Re: Modulus (Re: hashing function for strings)

#2069
From: Dik T. Winter
Date: Sat, 24 Feb 1990 23:00
31 lines
2314 bytes
In article <16014@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
 > In article <E*er-q@cs.psu.edu> callahan@mordor.endor.cs.psu.edu (Paul B. Callahan) writes:
 > >If we assume that floating point arithmetic is done using a sign-magnitude
 > >representation [then truncate is probably easier than floor to implement].
 > 
 > But, given that most implementations use two's complement for integers, and
 > even for floating-point exponents, why *is* sign-magnitude the standard for
 > floating point significands?
 > 
There is a good reason to use two's complement for integers: on an add
ignore carry, this reason is much less compelling when doing floating-point
arithmetic, you can not simply ignore carry.  Note also that the exponent is
not strictly two's complement, but has the sign bit inverted.  The reason is
that compare logic is simplified.

Further, IEEE specifies four rounding modes, so using a two's complement
mantissa because of simple truncation is no good reason.  It is even
stronger: when doing a round to nearest IEEE specifies that if the
exact result is halfway two representable numbers, that number has to be
chosen that has a low order zero bit (*).  With a two's complement
mantissa a similar requirement might be posed, but it would look more
complex, and would be more complex in the logic.
--
(*)  See [I think; this is from memory] IEEE Computer, Vol. 14, Issue 1.
This describes draft 8.0 of the IEEE standard and has a number of
accompanying articles.  The current standard is based on draft 10.0.
There are some differences, but they are not shocking.  I do not have
a reference for that standard.
-- 
dik t. winter, cwi, amsterdam, nederland
dik@cwi.nl
Technical Details
Message-ID: <8835@boring.cwi.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!dik
References: <Er$cfg@cs.psu.edu> <12099@goofy.megatest.UUCP> <98399@linus.UUCP> <E5$4$m@cs.psu.edu> <98717@linus.UUCP> <E*er-q@cs.psu.edu> <16014@haddock.ima.isc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!dik
From: dik@cwi.nl (Dik T. Winter)
Newsgroups: comp.theory,comp.misc,comp.lang.misc,comp.arch
Subject: Re: Modulus (Re: hashing function for strings)
Message-ID: <8835@boring.cwi.nl>
Date: 24 Feb 90 23:00:36 GMT
References: <Er$cfg@cs.psu.edu> <12099@goofy.megatest.UUCP> <98399@linus.UUCP> <E5$4$m@cs.psu.edu> <98717@linus.UUCP> <E*er-q@cs.psu.edu> <16014@haddock.ima.isc.com>
Sender: news@cwi.nl (The Daily Dross)
Followup-To: comp.theory
Organization: CWI, Amsterdam
Lines: 31