Re: Unexpected result using floor() function

Поиск
Список
Период
Сортировка
От Pujol Mathieu
Тема Re: Unexpected result using floor() function
Дата
Msg-id 56E6ECB3.5010405@realfusio.com
обсуждение исходный текст
Ответ на Re: Unexpected result using floor() function  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: Unexpected result using floor() function  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Unexpected result using floor() function  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general

Le 14/03/2016 15:29, Merlin Moncure a écrit :
> On Mon, Mar 14, 2016 at 9:21 AM, Pujol Mathieu
> <mathieu.pujol@realfusio.com> wrote:
>> Hi
>> I reproduce your bug using "PostgreSQL 9.3.6, compiled by Visual C++ build
>> 1600, 64-bit" on Windows 8
>> I also notice that SELECT floor(4.725 * power(10, 2)::numeric + 0.5) work as
>> expected
> I don't think this is a bug -- just peculiarities of floating point math.
>
> merlin
>
>
I think also that it is a float precision issue but the weird thing is
that both calls without floor return 273. Maybe the display method make
a rounding ?

SELECT 4.725 * power(10, 2)::numeric + 0.5) => 273.000
SELECT (4.725 * power(10, 2) + 0.5) => 273





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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: enum bug
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: enum bug