Re: power() function in Windows: "value out of range: underflow"
Euler Taveira <euler@timbira.com.br>
From: Euler Taveira <euler@timbira.com.br>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Huong Dangminh <huo-dangminh@ys.jp.nec.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-11T04:10:29Z
Lists: pgsql-bugs, pgsql-hackers
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. > FWIW, I tested in MSVC 2017 (15.6.4) and it worked like expected. Looking at [1], it seems there could be nasty bugs when using math functions in MSVC < 2013 (or 2015). I don't have some older MSVC here to try /fp:OPTIONHERE [2] to see if it makes any difference. [1] https://docs.microsoft.com/en-us/cpp/porting/floating-point-migration-issues [2] https://msdn.microsoft.com/pt-br/library/e7s85ffb.aspx -- Euler Taveira Timbira - http://www.timbira.com.br/ PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
Commits
-
Revert back-branch changes in power()'s behavior for NaN inputs.
- 99095b632094 9.3.23 landed
- f74d83b3034f 10.4 landed
- eab8d6312f15 9.6.9 landed
- 8fbdd63a52df 9.5.13 landed
- 70211459a507 9.4.18 landed
-
Avoid wrong results for power() with NaN input on more platforms.
- d9c7f56da464 9.3.23 landed
- d6ec3d2375ac 9.6.9 landed
- 9e4caa2748f4 9.5.13 landed
- 6bdf1303b34b 11.0 landed
- 59c2df3ae894 9.4.18 landed
- 217d8f3a19ae 10.4 landed
-
Avoid wrong results for power() with NaN input on some platforms.
- 534267e7f3ea 9.3.23 landed
- 48e0f8cbe0d9 9.6.9 landed
- 44ccd11cbbe6 9.4.18 landed
- 3b7fba935ec0 9.5.13 landed
- 61b200e2f582 11.0 landed
- 4d864de486d6 10.4 landed