End of Life Ruby 3.2 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));
}
Returns the arc sine of x.
-
Domain:
[-1, -1]. -
Range:
[-PI/2, PI/2].
Examples:
Example
asin(-1.0) # => -1.5707963267948966 # -PI/2 asin(0.0) # => 0.0 asin(1.0) # => 1.5707963267948966 # PI/2