Author: [email protected]
Date: Wed Jun 17 22:47:31 2009
New Revision: 2214

Modified:
    branches/bleeding_edge/src/runtime.cc

Log:
Speculative fix for computing Math.pow(2, -1074) on win32 where
the overloaded pow(double, int) function from math.h produces the
wrong answer.

[email protected]
Review URL: http://codereview.chromium.org/131022

Modified: branches/bleeding_edge/src/runtime.cc
==============================================================================
--- branches/bleeding_edge/src/runtime.cc       (original)
+++ branches/bleeding_edge/src/runtime.cc       Wed Jun 17 22:47:31 2009
@@ -4170,7 +4170,9 @@
          // internal precision in the pow() implementation would have
          // given us a finite p. This happens very rarely.
          double result = 1.0 / p;
-        return (result == 0 && isinf(p)) ? pow(x, y) : result;
+        return (result == 0 && isinf(p))
+            ? pow(x, static_cast<double>(y))  // Avoid pow(double, int).
+            : result;
        } else {
          return p;
        }

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to