Plato on Github
Report Home
node_modules/es5-ext/math/atanh/shim.js
Maintainability
57.84
Lines of code
14
Difficulty
18.75
Estimated Errors
0.11
Function weight
By Complexity
By SLOC
'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)); };