diff options
Diffstat (limited to 'node_modules/es5-ext/math/cosh/shim.js')
-rw-r--r-- | node_modules/es5-ext/math/cosh/shim.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/node_modules/es5-ext/math/cosh/shim.js b/node_modules/es5-ext/math/cosh/shim.js new file mode 100644 index 000000000..c762c84da --- /dev/null +++ b/node_modules/es5-ext/math/cosh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return 1; + if (!isFinite(value)) return Infinity; + return (exp(value) + exp(-value)) / 2; +}; |