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: Huong Dangminh <huo-dangminh@ys.jp.nec.com>
Cc: Euler Taveira <euler@timbira.com.br>, David Rowley <david.rowley@2ndquadrant.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>, "Pg Hackers" <pgsql-hackers@postgresql.org>, Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
Date: 2018-04-29T19:24:40Z
Lists: pgsql-bugs, pgsql-hackers
Huong Dangminh <huo-dangminh@ys.jp.nec.com> writes:
>> 2018-04-11 0:13 GMT-03:00 David Rowley <david.rowley@2ndquadrant.com>:
>>> I can recreate this when building with MSVC 2012. I confirm that I see
>>> the same as you. Microsoft are setting errno to EDOM in the above 3
>>> cases, where in Linux the result is still NaN, just the errno is not
>>> set.

> I updated the patch as David Rowley mentioned.

Pushed.  I'd mainly note that you need to update all the variant float8
expected-files, not just the primary one.  (Sometimes this requires a
bit of guesswork, but here we're expecting all platforms to produce
the same result.  The buildfarm should tell us if I got it wrong.)

			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.