Subject: | |
From: | |
Reply To: | |
Date: | Tue, 2 Jan 2007 12:27:21 EST |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Ray writes:
> I get it that I4 and R4 aren't really good choices
> for keys, but I don't see (from the manual) just what is happening (note
> that I did state I suck at math/algorithms). It may suffice to just
> know that an R4 is a bad key choice (but I'd still like to know why).
There's nothing inherently wrong with using an I4 dataitem for a key, but an
R4 is a very poor choice simply because the way that IMAGE works.
These two dataitem types are not hashed, but "moduloed", as Rene's earlier
post indicated. What that means is that only the two rightmost words (32-bits)
of the four words (64-bits) that compose an I4 or R4 dataitem are used in
creating the synonym.
That's perfectly all right for an I4 datatype because most of the information
(the "variability") of the bit patterns lie in the rightmost bits in an I4
dataitem, and that makes for good synonyms. Integer datatypes are
"right-justified". The least significant bits are the rightmost ones, no matter how many
words the dataitem is constructed of.
R4 datatypes are different. They're composed of an exponent and a mantissa,
and that information is "left-justified" in the dataitem (more than you wanted
to know: the mantissa is actually a fractional representation of the remainder
once the exponent has been divided out of the original number). What this
means is that most numbers have only a few leftmost bits active followed by a
large number of zeros. See the middle pictures for a +12 and -12 representation
on this page:
http://scitec.uwichill.edu.bb/cmp/online/P10F/numerical_Rep.htm
These rightmost zeros in an R4 number are what are used as the basis of the
synonym chain, and they're likely to be the same for great many numbers, hence
the synonym chain for all zeros fills up quite quickly.
Wirt Atmar
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|