Обсуждение: The question about the type numeric

Поиск
Список
Период
Сортировка

The question about the type numeric

От
"sure.postgres"
Дата:
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?
 
2014-04-15

body { font-size:12.1pt; font-family:simsun,serif; } blockquote { margin-top:0; margin-bottom:0; margin-left:2em; } body { padding:0; margin:0; }
wangshuo
HighGo Software Co.,Ltd.
Address: A203 Block D QILU Soft Park, High-Tech Zone, Lixia district, Jinan Shandong, China(Head Office)
Tel:+86-0531-55701530
Fax:+86-0531-55701544
Website:www.highgo.com
Mobile:18766416137

Re: The question about the type numeric

От
amulsul
Дата:
>But the sign is 0.
>So is there anything wrong?
have look in src/backend/utils/adt/numeric.c @ 154 & 155 for POS & NEG
defination given as154 #define NUMERIC_POS                     0x0000155 #define NUMERIC_NEG
0x4000

Regards,
Amul Sul



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/The-question-about-the-type-numeric-tp5800180p5800219.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.