Re: power() function in Windows: "value out of range: underflow"

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Huong Dangminh <huo-dangminh@ys.jp.nec.com>, Pg Hackers <pgsql-hackers@postgresql.org>, Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
Date: 2018-04-29T22:22:42Z
Lists: pgsql-bugs, pgsql-hackers
David Rowley <david.rowley@2ndquadrant.com> writes:
> Wouldn't this machine have returned 1 before this patch though?

No, don't think so, because it doesn't set EDOM for the case.

Basically what we're doing here is making sure that we get results
conforming to current POSIX even on machines that predate that
standard.  There are more of them floating around than I'd have
expected, but it still seems like a good change to make.  Maybe
there's an argument for not back-patching, though?

			regards, tom lane


Commits

  1. Revert back-branch changes in power()'s behavior for NaN inputs.

  2. Avoid wrong results for power() with NaN input on more platforms.

  3. Avoid wrong results for power() with NaN input on some platforms.