atanh(p1)
public
Computes the inverse hyperbolic tangent of x.
Domain: (-1, 1)
Codomain: (-INFINITY, INFINITY)
Math.atanh(1)
Show source
static VALUE
math_atanh(VALUE unused_obj, VALUE x)
{
double d;
d = Get_Double(x);
/* check for domain error */
if (d < -1.0 || +1.0 < d) domain_error("atanh");
/* check for pole error */
if (d == -1.0) return DBL2NUM(-INFINITY);
if (d == +1.0) return DBL2NUM(+INFINITY);
return DBL2NUM(atanh(d));
}