Rounding incompatibility

Поиск
Список
Период
Сортировка
От Havasvölgyi Ottó
Тема Rounding incompatibility
Дата
Msg-id 34608c0c0906150358xbc53de2pe0c7053779e7b0ca@mail.gmail.com
обсуждение исходный текст
Ответы Re: Rounding incompatibility  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Rounding incompatibility  (Gurjeet Singh <singh.gurjeet@gmail.com>)
Список pgsql-general
Hi,

I have found the following strangeness on Windows versions:

create table round_test (id int primary key, value double precision);
insert into round_test(id, value) values(1, 1.5);
insert into round_test(id, value) values(2, -1.5);
insert into round_test(id, value) values(3, 3.5);
select round(value) from round_test;

psql 8.2.13 returns

2
-2
4

But psql 8.3.3 returns

1
-1
3

Trying more values it seems that 8.2 rounding works according to banker's rounding rules.
Can you confirm this?
How can I avoid this incompatibility or perhaps bug?

Thanks,
Otto

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

Предыдущее
От: Havasvölgyi Ottó
Дата:
Сообщение: Re: Trigger Function and backup
Следующее
От: CM J
Дата:
Сообщение: Postgres 8.2 Memory Tuning