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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4653: zero with negative sign returned on round(sin) function
Дата
Msg-id 20019.1234563193@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4653: zero with negative sign returned on round(sin) function  ("Marco Vieira" <maovieira@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Marco Vieira"
Дата:
Сообщение: BUG #4653: zero with negative sign returned on round(sin) function
Следующее
От: David Newall
Дата:
Сообщение: Lost search_path after transaction fails