Author: Stephan <[email protected]>
Branch:
Changeset: r219:3465d30a9200
Date: 2012-05-22 19:05 +0200
http://bitbucket.org/pypy/lang-js/changeset/3465d30a9200/
Log: 15.8.2.8
diff --git a/js/builtins_math.py b/js/builtins_math.py
--- a/js/builtins_math.py
+++ b/js/builtins_math.py
@@ -28,7 +28,7 @@
put_native_function(w_Math, 'atan2', js_atan2, params = ['y', 'x'])
put_native_function(w_Math, 'ceil', js_ceil, params = ['x'])
put_native_function(w_Math, 'cos', js_cos, params = ['x'])
-
+ put_native_function(w_Math, 'exp', js_exp, params = ['x'])
# 15.8.1
@@ -310,6 +310,22 @@
return math.cos(x)
+# 15.8.2.8
+def js_exp(this, args):
+ arg0 = get_arg(args, 0)
+ x = arg0.ToNumber()
+
+ if isnan(x):
+ return NAN
+
+ if x == INFINITY:
+ return INFINITY
+
+ if x == -INFINITY:
+ return 0
+
+ return math.exp(x)
+
import time
from pypy.rlib import rrandom
_random = rrandom.Random(int(time.time()))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit