Re: round() function wrong?

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: round() function wrong?
Дата
Msg-id 1067023581.5995.1.camel@fuji.krosing.net
обсуждение исходный текст
Ответ на Re: round() function wrong?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut kirjutas R, 24.10.2003 kell 22:16:
> 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. 

Also, which way is up ?

hannu=# select round(0.5);round
-------    1
(1 row)
hannu=# select round(-0.5);round
-------   -1
(1 row)


>  On systems with IEEE 754 floating point, the default is
> normally to round to the nearest even number.


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: round() function wrong?
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: PostgreSQL on Novell Netware 6.5.