[Webkit-unassigned] [Bug 34462] Fix a bug that Math.round() retunrs incorrect results for huge integers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 1 19:46:59 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34462





--- Comment #2 from Darin Adler <darin at apple.com>  2010-02-01 19:46:59 PST ---
(From update of attachment 47901)
How about this instead?

-    if (signbit(arg) && arg >= -0.5)
-         return jsNumber(exec, -0.0);
-    return jsNumber(exec, floor(arg + 0.5));
+    double integer = ceil(arg);
+    return jsNumber(exec, integer - (integer - arg > 0.5));

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list