Re: Question about the TODO, numerics, and division

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Question about the TODO, numerics, and division
Дата
Msg-id 87fy7yhhxk.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Question about the TODO, numerics, and division  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> but I wouldn't want to defend the details of the rule about how many
> fractional digits out given so many fractional digits in.

In particular it seems to me this is poor:

postgres=# select 1::numeric/10;       ?column?        
------------------------0.10000000000000000000
(1 row)


In an ideal world it seems to me that if you're dividing by a number with only
factors of 2 and 5 you should only gain as many digits as necessary to
represent the result exactly.

At the very least if you're dividing by a power of ten we should just move the
decimal place and keep the same overall precision.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Question about the TODO, numerics, and division
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: GSoC's possible project