Re: Unexpected result using floor() function

Поиск
Список
Период
Сортировка
От Frank Millman
Тема Re: Unexpected result using floor() function
Дата
Msg-id 1083091068AD4C5FA89166F0470FDD70@FrankLaptop
обсуждение исходный текст
Ответ на Unexpected result using floor() function  ("Frank Millman" <frank@chagford.com>)
Ответы Re: Unexpected result using floor() function  ("Frank Millman" <frank@chagford.com>)
Список pgsql-general
> I am running PostgreSQL 9.4.4 on Fedora 22.
>
> SELECT floor(4.725 * 100 + 0.5) returns 473, which is what I expected.
>
> SELECT floor(4.725 * power(10, 2) + 0.5) returns 472, which I find surprising.
>
> Please can someone explain the anomaly.
 
Thanks for all the responses.
 
Plenty of workarounds. I can carry on now :-)
 
Frank
 

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

Предыдущее
От: Elein
Дата:
Сообщение: Re: enum bug
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: Suppress decimal point like digits in to_char?