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

Unified Diff: src/harmony-math.js

Issue 163563003: Harmony: implement Math.cbrt, Math.expm1 and Math.log1p. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: uploaded new Created 6 years, 10 months 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/harmony-math.js
diff --git a/src/harmony-math.js b/src/harmony-math.js
index c856ce72b220f352a56a4f81071a98dd45888e56..7856917890b5f3f4c0369a8731c6892a8ef57346 100644
--- a/src/harmony-math.js
+++ b/src/harmony-math.js
@@ -174,6 +174,24 @@ function MathClz32(x) {
}
+//ES6 draft 09-27-13, section 20.2.2.9.
+function MathCbrt(x) {
+ return %Math_cbrt(TO_NUMBER_INLINE(x));
+}
+
+
+//ES6 draft 09-27-13, section 20.2.2.14.
+function MathExpm1(x) {
+ return %Math_expm1(TO_NUMBER_INLINE(x));
+}
+
+
+//ES6 draft 09-27-13, section 20.2.2.20.
+function MathLog1p(x) {
+ return %Math_log1p(TO_NUMBER_INLINE(x));
+}
+
+
function ExtendMath() {
%CheckIsBootstrapping();
@@ -191,7 +209,10 @@ function ExtendMath() {
"log2", MathLog2,
"hypot", MathHypot,
"fround", MathFround,
- "clz32", MathClz32
+ "clz32", MathClz32,
+ "cbrt", MathCbrt,
+ "log1p", MathLog1p,
+ "expm1", MathExpm1
));
}
« 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