End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Math.acosh
Math.acosh(x) → Float
math.c
View on GitHub ↗
static VALUE
math_acosh(VALUE unused_obj, VALUE x)
{
double d;
d = Get_Double(x);
/* check for domain error */
if (d < 1.0) domain_error("acosh");
return DBL2NUM(acosh(d));
}
Computes the inverse hyperbolic cosine of x.
Domain: [1, INFINITY)
Codomain: [0, INFINITY)
Example
Math.acosh(1) #=> 0.0