Re: BUG #15434: NUMERIC without any precision or scale truncates scale to 16 digits

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #15434: NUMERIC without any precision or scale truncates scale to 16 digits
Дата
Msg-id 87a7ne879r.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на BUG #15434: NUMERIC without any precision or scale truncates scale to16 digits  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15434: NUMERIC without any precision or scale truncatesscale to 16 digits  (Andrey <parihaaraka@gmail.com>)
Список pgsql-bugs
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG>  1800000000000000001::numeric / (10^18)::numeric truncated, --
 PG> truncates to 16 digits after decimal point

It has to truncate it _somewhere_, because otherwise 1::numeric / 3
would be infinitely long...

The choice that numeric division actually makes is to produce a result
with at least 16 significant figures, but also with at least as many
decimal places as the display scale of either of the inputs.

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Andrey
Дата:
Сообщение: Re: NOTIFY does not work as expected
Следующее
От: Andrey
Дата:
Сообщение: Re: BUG #15434: NUMERIC without any precision or scale truncatesscale to 16 digits