Re: BUG #1577: round(dp) function does not round to nearest integer properly

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1577: round(dp) function does not round to nearest integer properly
Дата
Msg-id 12942.1113163024@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #1577: round(dp) function does not round to nearest integer properly  ("Roman Schayuk" <rschayuk@rogers.com>)
Ответы Re: BUG #1577: round(dp) function does not round to nearest integer properly  (Russell Smith <russell@pws.com.au>)
Список pgsql-bugs
"Roman Schayuk" <rschayuk@rogers.com> writes:
> gap=> select round(42.5);
>  round
> -------
>     42
> (1 row)
> Result has to be 43

No, the above is perfectly correct and in fact required by the IEEE
standard for floating-point arithmetic (because round-to-nearest-even
is the default rounding mode).

If anything needs to be changed here, it's the behavior of round(numeric).

            regards, tom lane

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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: BUG #1579: DO NOT CONNECT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1582: boolean DEFAULT TRUE results in FALSE for NULL values