Re: BUG #18951: Precision loss in inner join while using SUM aggregate function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #18951: Precision loss in inner join while using SUM aggregate function
Дата
Msg-id 183009.1749397821@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #18951: Precision loss in inner join while using SUM aggregate function  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> -- judgement: s1 = s2 + s3, However, s2 is not correctly computed

[ shrug... ] If you are expecting exact results, don't use
floating-point arithmetic (ie, use "numeric" not "double precision").
This example, which will result in adding values of enormously
different magnitudes in various orders, is tailor-made to
exhibit roundoff error.

https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT

            regards, tom lane



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