pgsql: Fix power() for infinity inputs some more.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix power() for infinity inputs some more.
Дата
Msg-id E1jkrmG-0002vr-1z@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix power() for infinity inputs some more.

Buildfarm results for commit decbe2bfb show that AIX and illumos
have non-POSIX-compliant pow() functions, as do ancient NetBSD
and HPUX releases.  While it's dubious how much we should care
about the latter two platforms, the former two are probably enough
reason to put in manual handling of infinite-input cases.  Hence,
do so, and clean up the post-pow() error handling to reflect its
now-more-limited scope.  (Notably, while we no longer expect to
ever see EDOM from pow(), report it as a domain error if we do.
The former coding had the net effect of expensively converting the
error to ERANGE, which seems highly questionable: if pow() wanted
to report ERANGE, it would have done so.)

Patch by me; thanks to Michael Paquier for review.

Discussion: https://postgr.es/m/E1jkU7H-00024V-NZ@gemulon.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e532b1d57df9b55557263303dba883e06521b0d2

Modified Files
--------------
src/backend/utils/adt/float.c        | 114 ++++++++++++++++++++++++++++-------
src/test/regress/expected/float8.out |   2 +
src/test/regress/sql/float8.sql      |   1 +
3 files changed, 94 insertions(+), 23 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Fix behavior of exp() and power() for infinity inputs.
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Assorted cleanup of tar-related code.