Re: round() function wrong? - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: round() function wrong?
Date
Msg-id 1067023581.5995.1.camel@fuji.krosing.net
Whole thread Raw
In response to Re: round() function wrong?  (Peter Eisentraut <peter_e@gmx.net>)
List 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 by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: round() function wrong?
Next
From: Hannu Krosing
Date:
Subject: Re: PostgreSQL on Novell Netware 6.5.