Fixing Math.pow(NaN, -0.0) == 1 on Windows.

Review URL: http://codereview.chromium.org/8804005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2011-12-05 09:54:15 +00:00
parent b45f451a27
commit 1df183c5ae

View File

@ -1124,6 +1124,8 @@ double power_double_double(double x, double y) {
if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0. if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0.
if (y == -0.5) return 1.0 / sqrt(x + 0.0); if (y == -0.5) return 1.0 / sqrt(x + 0.0);
} }
#else
if (y == 0) return 1.0; // Returns 1.0 for exponent 0.
#endif #endif
if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) { if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
return OS::nan_value(); return OS::nan_value();