Re: The question about the type numeric

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: The question about the type numeric
Дата
Msg-id CA+TgmobfzprBsXJh9DkT7d3QkVm=-hNCV8oOzRW3Ya_robEDEQ@mail.gmail.com
обсуждение исходный текст
Ответ на The question about the type numeric  ("sure.postgres" <sure.postgres@gmail.com>)
Список pgsql-hackers
On Tue, Apr 15, 2014 at 5:37 AM, sure.postgres <sure.postgres@gmail.com> wrote:
> Hi hackers,
>
> I am learning about numeric .
> The comment of NumericShort format is:
>  * In the NumericShort format, the remaining 14 bits of the header word
>  * (n_short.n_header) are allocated as follows: 1 for sign (positive or
>  * negative), 6 for dynamic scale, and 7 for weight.  In practice, most
>  * commonly-encountered values can be represented this way.
>
> So the Max of the NumericShort format should be up to 508 digits before the
> decimal point.
> So the sign of the number 12345678901234567890123456789012345678901234567890
> 12345678901234567890123456789012345678901234567890123456789012345678901234567890
> 12345678901234567890123456789012345678901234567890123456789012345678901234567890
> 12345678901234567890123456789012345678901234567
> should be 0x807F.
> The number is 257 digits before the decimal point.
> But the sign is 0.
> So is there anything wrong?

I'm not sure I understand the question, but if it helps, the sign bit
will be set (1) for negative values and clear (0) for positive values.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Clock sweep not caching enough B-Tree leaf pages?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Clock sweep not caching enough B-Tree leaf pages?