Compute Natural Logarithm x + 1

Compute an implementation-dependent approximation to the natural logarithm of 1 + x. The result is computed in a way that is accurate even when the value of x is close to zero.

Examples in JavaScript
console.log(Math.log1p(1));
// expected output: 0.6931471805599453

console.log(Math.log1p(0));
// expected output: 0

console.log(Math.log1p(-1));
// expected output: -Infinity

console.log(Math.log1p(-2));
// expected output: NaN

Math.log1p(1);  // 0.6931471805599453
Math.log1p(0);  // 0
Math.log1p(-1); // -Infinity
Math.log1p(-2); // NaN