Fix power() for infinity inputs some more.
authorTom Lane <[email protected]>
Mon, 15 Jun 2020 16:15:56 +0000 (12:15 -0400)
committerTom Lane <[email protected]>
Mon, 15 Jun 2020 16:15:56 +0000 (12:15 -0400)
commite532b1d57df9b55557263303dba883e06521b0d2
treebe8bfcd58718b72e78514377d006d83c00741d56
parent7a3543c2ea23d032865f207c2605942b7a32e9ba
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/[email protected]
src/backend/utils/adt/float.c
src/test/regress/expected/float8.out
src/test/regress/sql/float8.sql