Re: BUG in postgres mathematic

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG in postgres mathematic
Дата
Msg-id 28460.980481150@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG in postgres mathematic  ("Robert B. Easter" <reaster@comptechnews.com>)
Ответы Re: BUG in postgres mathematic  ("Robert B. Easter" <reaster@comptechnews.com>)
Re: BUG in postgres mathematic  ("Robert B. Easter" <reaster@comptechnews.com>)
Список pgsql-bugs
"Robert B. Easter" <reaster@comptechnews.com> writes:
> This problem is not specific to Postgres.

The fact that 5*27.81*100 != 27.81*100*5 is certainly a garden-variety
floating-point roundoff error.  However, I think Max has a fair
complaint here: it seems float-to-int8 conversion is truncating, not
rounding like the other conversions to integer do.

regression=# select 4.7::float8::int4;
 ?column?
----------
        5
(1 row)

regression=# select 4.7::float8::int8;
 ?column?
----------
        4
(1 row)

Seems to me this is a bug we should fix.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: large objects overwriting bug
Следующее
От: Tom Lane
Дата:
Сообщение: Re: select fails on indexed varchars.