class method
Math.atanh
(::Math::double x) -> ::Float
Math.atanh(x) → float
math.c
View on GitHub ↗
static VALUE
math_atanh(VALUE unused_obj, VALUE x)
{
double d;
d = Get_Double(x);
domain_check_range(d, -1.0, +1.0, "atanh");
/* check for pole error */
if (d == -1.0) return DBL2NUM(-HUGE_VAL);
if (d == +1.0) return DBL2NUM(+HUGE_VAL);
return DBL2NUM(atanh(d));
}
Returns the inverse hyperbolic tangent of x.
-
Domain:
[-1, 1]. -
Range:
[-INFINITY, INFINITY].
Examples:
Example
atanh(-1.0) # => -Infinity atanh(0.0) # => 0.0 atanh(1.0) # => Infinity