Compute Inverse Hyperbolic Tangent
Examples in
JavaScript
console.log(Math.atanh(-1));
// expected output: -Infinity
console.log(Math.atanh(0));
// expected output: 0
console.log(Math.atanh(0.5));
// expected output: 0.549306144334055 (approximately)
console.log(Math.atanh(1));
// expected output: Infinity
Math.atanh(-2); // NaN
Math.atanh(-1); // -Infinity
Math.atanh(0); // 0
Math.atanh(0.5); // 0.5493061443340548
Math.atanh(1); // Infinity
Math.atanh(2); // NaN