mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
15 lines
384 B
JavaScript
15 lines
384 B
JavaScript
var $ = require('../internals/export');
|
|
var expm1 = require('../internals/math-expm1');
|
|
|
|
var exp = Math.exp;
|
|
|
|
// `Math.tanh` method
|
|
// https://tc39.github.io/ecma262/#sec-math.tanh
|
|
$({ target: 'Math', stat: true }, {
|
|
tanh: function tanh(x) {
|
|
var a = expm1(x = +x);
|
|
var b = expm1(-x);
|
|
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
|
|
}
|
|
});
|