End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Math.asin
Math.asin(x) → Float
math.c
View on GitHub ↗
static VALUE
math_asin(VALUE unused_obj, VALUE x)
{
double d;
d = Get_Double(x);
domain_check_range(d, -1.0, 1.0, "asin");
return DBL2NUM(asin(d));
}
Computes the arc sine of x. Returns -PI/2..PI/2.
Domain: [-1, -1]
Codomain: [-PI/2, PI/2]
Example
Math.asin(1) == Math::PI/2 #=> true