Re: some errors and/or bugs?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: some errors and/or bugs?
Дата
Msg-id Pine.LNX.4.30.0012191732170.1000-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: some errors and/or bugs?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: some errors and/or bugs?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-docs
Tom Lane writes:

> It's correct, if the underlying float arithmetic is IEEE-compliant.
> Rounding for exact half-integral values is supposed to be "round to
> nearest even".  So 42.5 goes to 42, but 43.5 goes to 44.
>
> I notice our NUMERIC rounding code does not do that ... perhaps it
> should.

More precisely, an IEEE-compliant system would offer the choice of
rounding up, rounding down, rounding toward zero, or rounding toward even.
I would guess that the default is merely the potentially best performing.

We could offer these options (much more easily) for the numeric case, but
since numeric is very often used for business type applications, the
customary rounding method (up) should be preferred.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


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

Предыдущее
От: "Steve Howe"
Дата:
Сообщение: Probable error on docs
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Generating HISTORY file