UNPKG

231 BJavaScriptView Raw
1var log = Math.log;
2
3// `Math.log1p` method implementation
4// https://tc39.github.io/ecma262/#sec-math.log1p
5module.exports = Math.log1p || function log1p(x) {
6 return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
7};