Re: Abbreviated keys for Numeric - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Abbreviated keys for Numeric
Date
Msg-id CAM3SWZQW1YhqfA+FpvWcPivYUWqWhgWCM-LrRUfmAcDAzDETLg@mail.gmail.com
Whole thread Raw
In response to Re: Abbreviated keys for Numeric  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Mon, Mar 23, 2015 at 12:52 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> As
> + * with IEEE-754, we use an exponent without a sign (a 7-bit exponent
> + * without a sign).
>
> As to the beginning of this sentence, bringing IEEE-754 into this
> discussion doesn't clarify anything in my mind.  I don't think most
> people reading these comments are likely to be familiar with IEEE-754,
> or want to go look it up.  As to the end of the sentence, writing "an
> exponent without a sign" and then describing that as "a 7-bit exponent
> without a sign" is extremely redundant.  Perhaps you were trying to
> say that we are similar to IEEE-754 in that we use an exponent without
> a sign (whatever that means) but different in that we ours is 7-bits,
> but it's not really clear.

The IEEE-754 exponent does not have a signedness bit, but can still be
"logically" negative (while still being manipulated like an unsigned
integer for addition and subtraction type purposes). That's why it
uses what they call an exponent bias - excess-127, for single
precision floats, and excess-1023 for double precision floats. Once
you do go and Google that, you can find many illustrative diagrams and
so on. Andrew's term "excess-44", on the other hand, shows no relevant
pages on the first page of Google results (you have to search for
"excess-k" to get any hint of what that even is). Regardless of
anything else, I really don't think that Andrew's non-explanation of
the much more obscure "excess-44" is okay.

> I offer these not in the spirit of asking you to correct these
> specific things but just of explaining generally the sort of thing
> that causes me to prefer Andrew's version.  Hope that's helpful.

I think that you make some valid points. Thank you.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Abbreviated keys for Numeric
Next
From: Andres Freund
Date:
Subject: Re: Remove fsync ON/OFF as a visible option?