Re: round() function wrong?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: round() function wrong?
Дата
Msg-id Pine.LNX.4.44.0310242114120.18767-100000@peter.localdomain
обсуждение исходный текст
Ответ на round() function wrong?  ("Jochen Westland [invigo]" <jochen.westland@invigo.de>)
Ответы Re: round() function wrong?  (Hannu Krosing <hannu@tm.ee>)
Список pgsql-hackers
Jochen Westland [invigo] writes:

> In my version
> select round(2.5); returns 2;
> select round(2.5000001) returns 3;
>
> refering to my math professor thats wrong, at least in germany.
> select round(2.5); should return 3

The convention that .5 values should be rounded up is just that, a
convention.  On systems with IEEE 754 floating point, the default is
normally to round to the nearest even number.

-- 
Peter Eisentraut   peter_e@gmx.net



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

Предыдущее
От: Marko Karppinen
Дата:
Сообщение: Re: Call for port reports
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: round() function wrong?