Avoid wrong results for power() with NaN input on more platforms. Buildfarm results show that the modern POSIX rule that 1 ^ NaN = 1 is not honored on *BSD until relatively recently, and really old platforms don't believe that NaN ^ 0 = 1 either. (This is unsurprising, perhaps, since SUSv2 doesn't require either behavior.) In hopes of getting to platform independent behavior, let's deal with all the NaN-input cases explicitly in dpow().
Note that numeric_power() doesn't know either of these special cases. But since that behavior is platform-independent, I think it should be addressed separately, and probably not back-patched. Discussion: https://postgr.es/m/[email protected] Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9e4caa2748f469d3f37a68f5012a2993dad0db10 Modified Files -------------- src/backend/utils/adt/float.c | 24 +++++++++++++++++++--- .../expected/float8-exp-three-digits-win32.out | 6 ++++++ src/test/regress/expected/float8-small-is-zero.out | 6 ++++++ .../regress/expected/float8-small-is-zero_1.out | 6 ++++++ src/test/regress/expected/float8.out | 6 ++++++ src/test/regress/sql/float8.sql | 1 + 6 files changed, 46 insertions(+), 3 deletions(-)
