Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group