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

From Peter Eisentraut
Subject Re: round() function wrong?
Date
Msg-id Pine.LNX.4.44.0310242114120.18767-100000@peter.localdomain
Whole thread Raw
In response to round() function wrong?  ("Jochen Westland [invigo]" <jochen.westland@invigo.de>)
Responses Re: round() function wrong?
List 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 by date:

Previous
From: Marko Karppinen
Date:
Subject: Re: Call for port reports
Next
From: Hannu Krosing
Date:
Subject: Re: round() function wrong?