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

From: "Marco Vieira" <maovieira(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4653: zero with negative sign returned on round(sin) function
Date: 2009-02-13 21:58:00
Message-ID: 200902132158.n1DLw00Z052532@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4653
Logged by: Marco Vieira
Email address: maovieira(at)gmail(dot)com
PostgreSQL version: 8.3.5
Operating system: x86_64-pc-linux-gnu (ubuntu 4.3.2-1ubuntu11 )
Description: zero with negative sign returned on round(sin) function
Details:

If I query select round(sin(2.0*pi()*0.51)) I get "-0" as return but zero is
unsigned.

but: select sin(2.0*pi()*0.51)
returns: -0.0627905195293133
and select round(-0.0627905195293133)
returns: 0 (no sign)

I used cast to work around it: select round(sin(2.0*pi()*0.51))::int

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-02-13 22:13:13 Re: BUG #4653: zero with negative sign returned on round(sin) function
Previous Message Tom Lane 2009-02-13 15:32:01 Re: 8.3.5: Query Planner takes 15+ seconds to plan Update or Delete queries on partitioned tables.