Re: round() function wrong?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: round() function wrong?
Дата
Msg-id 17313.1067295184@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: round() function wrong?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-hackers
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> So it would appear to be that the automatic assumptions about what is 
> float and what is numeric changed from 7.2 to 7.3, i.e. it's assumed that 
> numeric is the input type.

That's correct.

Looking at the code, round(numeric) always rounds xxx.5 values away from
zero (0.5 -> 1, -0.5 -> -1, etc).  The behavior of round(float) is
platform-dependent, but round-to-nearest-even is the rule used by IEEE
compliant platforms.
        regards, tom lane


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