Re: BUG #4653: zero with negative sign returned on round(sin) function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4653: zero with negative sign returned on round(sin) function
Date
Msg-id 20019.1234563193@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4653: zero with negative sign returned on round(sin) function  ("Marco Vieira" <maovieira@gmail.com>)
List pgsql-bugs
"Marco Vieira" <maovieira@gmail.com> writes:
> If I query select round(sin(2.0*pi()*0.51)) I get "-0" as return but zero is
> unsigned.

In IEEE-standard float arithmetic, that isn't true --- zero and minus
zero are distinguishable values.  This is not a bug but just the way
your platform chooses to define the result of rounding a small
negative value.

(Or at least, if you are convinced it's a bug, take it up with the
glibc authors not us.)

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Marco Vieira"
Date:
Subject: BUG #4653: zero with negative sign returned on round(sin) function
Next
From: David Newall
Date:
Subject: Lost search_path after transaction fails