Re: Unexpected result using floor() function

Поиск
Список
Период
Сортировка
От Chris Mair
Тема Re: Unexpected result using floor() function
Дата
Msg-id 0330e2fc5115dab378d6282dc283b088@smtp.hushmail.com
обсуждение исходный текст
Ответ на Re: Unexpected result using floor() function  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Hi,

maybe this is a late reply, but also note that 4.725 alone already cannot be
represented in floating point exactly (and this has nothing to do with Postgres).

Just sum it up 100 times to "see" the round off error becoming visible:

chris=# select sum(4.725::double precision) from generate_series(1,100);
        sum
------------------
  472.500000000001
(1 row)

vs.

chris=# select sum(4.725::numeric) from generate_series(1,100);
    sum
---------
  472.500
(1 row)

Bye,
Chris.




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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: ON CONFLICT DO NOTHING RETURNING
Следующее
От: "drum.lucas@gmail.com"
Дата:
Сообщение: Unique UUID value - PostgreSQL 9.2