Re: Money data type in PostgreSQL?
От | Jan Wieck |
---|---|
Тема | Re: Money data type in PostgreSQL? |
Дата | |
Msg-id | 3FD15523.9090400@Yahoo.com обсуждение исходный текст |
Ответ на | Re: Money data type in PostgreSQL? (Graham Leggett <minfrin@sharp.fm>) |
Список | pgsql-general |
Graham Leggett wrote: > Jan Wieck wrote: > >> You won't get any rounding errors in NUMERIC either. What people should >> be concerned of is to find an arbitrary precision package for the >> frontend programming language they're using. > > What is the definition of a numeric number? I understand (from studying > numeric methods all those years ago) that the base 10 decimal number 0.1 > cannot be stored exactly in base 2 floating point, thus my use of > integers - is numeric an arbitrary precision concept? The PostgreSQL datatype NUMERIC is performing decimal arithmetic. The original I wrote used to do it string based, with one digit per byte but stored the number as some sort of BCD, one digit per nibble. Tom Lane changed that a while back into base 10,000 storage and calculation, which has the advantages of doing 4 digits per loop and no need to convert back and forth between the storage and the computational representation. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #
В списке pgsql-general по дате отправления: