Re: BUG #1577: round(dp) function does not round to nearest integer properly - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1577: round(dp) function does not round to nearest integer properly
Date
Msg-id 12942.1113163024@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1577: round(dp) function does not round to nearest integer properly  ("Roman Schayuk" <rschayuk@rogers.com>)
Responses Re: BUG #1577: round(dp) function does not round to nearest integer properly
List 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 by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1579: DO NOT CONNECT
Next
From: Tom Lane
Date:
Subject: Re: BUG #1582: boolean DEFAULT TRUE results in FALSE for NULL values