Re: BUG #4653: zero with negative sign returned on round(sin) function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marco Vieira" <maovieira(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4653: zero with negative sign returned on round(sin) function
Date: 2009-02-13 22:13:13
Message-ID: 20019.1234563193@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Marco Vieira" <maovieira(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Newall 2009-02-14 02:17:38 Lost search_path after transaction fails
Previous Message Marco Vieira 2009-02-13 21:58:00 BUG #4653: zero with negative sign returned on round(sin) function