Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(728)

Unified Diff: src/math.js

Issue 88053002: Implement Math.ceil via Math.floor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/math.js
diff --git a/src/math.js b/src/math.js
index 789886e2d1c4abf87d0bb2ba5612e35f1f263e33..5cbe94a35c7be9d71024a39b266ec8e920e022b6 100644
--- a/src/math.js
+++ b/src/math.js
@@ -74,7 +74,7 @@ function MathAtan2(y, x) {
// ECMA 262 - 15.8.2.6
function MathCeil(x) {
- return %Math_ceil(TO_NUMBER_INLINE(x));
+ return -MathFloor(-x);
}
// ECMA 262 - 15.8.2.7
@@ -348,6 +348,7 @@ function SetUpMath() {
"imul", MathImul
));
+ %SetInlineBuiltinFlag(MathCeil);
%SetInlineBuiltinFlag(MathRandom);
%SetInlineBuiltinFlag(MathSin);
%SetInlineBuiltinFlag(MathCos);
« no previous file with comments | « no previous file | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698