math-log1p.js 231 B

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