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

Поиск
Список
Период
Сортировка
От Marco Vieira
Тема BUG #4653: zero with negative sign returned on round(sin) function
Дата
Msg-id 200902132158.n1DLw00Z052532@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4653: zero with negative sign returned on round(sin) function
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4653
Logged by:          Marco Vieira
Email address:      maovieira@gmail.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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 8.3.5: Query Planner takes 15+ seconds to plan Update or Delete queries on partitioned tables.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4653: zero with negative sign returned on round(sin) function