Author: [email protected]
Date: Mon Jun 15 01:27:38 2009
New Revision: 2161

Modified:
    branches/bleeding_edge/src/math.js

Log:
Avoid sign issues with the fast case code for Math.floor().
Review URL: http://codereview.chromium.org/126115

Modified: branches/bleeding_edge/src/math.js
==============================================================================
--- branches/bleeding_edge/src/math.js  (original)
+++ branches/bleeding_edge/src/math.js  Mon Jun 15 01:27:38 2009
@@ -95,8 +95,8 @@
  // ECMA 262 - 15.8.2.9
  function MathFloor(x) {
    if (!IS_NUMBER(x)) x = ToNumber(x);
-  if (0 < x && x <= 0xFFFFFFFF) {
-    // Numbers in the range [0, 2^32) can be floored by converting
+  if (0 < x && x <= 0x7FFFFFFF) {
+    // Numbers in the range [0, 2^31) can be floored by converting
      // them to an unsigned 32-bit value using the shift operator.
      // We avoid doing so for -0, because the result of Math.floor(-0)
      // has to be -0, which wouldn't be the case with the shift.

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

Reply via email to