aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/es6.math.tanh.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/modules/es6.math.tanh.js')
-rw-r--r--node_modules/core-js/modules/es6.math.tanh.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/core-js/modules/es6.math.tanh.js b/node_modules/core-js/modules/es6.math.tanh.js
new file mode 100644
index 000000000..d2f10778c
--- /dev/null
+++ b/node_modules/core-js/modules/es6.math.tanh.js
@@ -0,0 +1,12 @@
+// 20.2.2.33 Math.tanh(x)
+var $export = require('./_export')
+ , expm1 = require('./_math-expm1')
+ , exp = Math.exp;
+
+$export($export.S, 'Math', {
+ tanh: function tanh(x){
+ var a = expm1(x = +x)
+ , b = expm1(-x);
+ return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
+ }
+}); \ No newline at end of file