1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-12 10:52:47 +00:00
Files
mywebsite/node_modules/es5-ext/math/atanh/shim.js

15 lines
289 B
JavaScript

'use strict';
var log = Math.log;
module.exports = function (x) {
if (isNaN(x)) return NaN;
x = Number(x);
if (x < -1) return NaN;
if (x > 1) return NaN;
if (x === -1) return -Infinity;
if (x === 1) return Infinity;
if (x === 0) return x;
return 0.5 * log((1 + x) / (1 - x));
};