Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 3760) |
+++ src/runtime.cc (working copy) |
@@ -4662,7 +4662,8 @@ |
CONVERT_DOUBLE_CHECKED(x, args[0]); |
if (signbit(x) && x >= -0.5) return Heap::minus_zero_value(); |
- return Heap::NumberFromDouble(floor(x + 0.5)); |
+ double integer = ceil(x); |
+ return Heap::NumberFromDouble(integer - x > 0.5 ? integer - 1.0 : integer); |
} |