class method
Math.atan
(::Math::double x) -> ::Float
Math.atan(x) → Float
math.c
View on GitHub ↗
static VALUE
math_atan(VALUE unused_obj, VALUE x)
{
return DBL2NUM(atan(Get_Double(x)));
}
Returns the arc tangent of x.
-
Domain:
[-INFINITY, INFINITY]. -
Range:
[-PI/2, PI/2].
Examples:
Example
atan(-INFINITY) # => -1.5707963267948966 # -PI2 atan(-PI) # => -1.2626272556789115 atan(-PI/2) # => -1.0038848218538872 atan(0.0) # => 0.0 atan(PI/2) # => 1.0038848218538872 atan(PI) # => 1.2626272556789115 atan(INFINITY) # => 1.5707963267948966 # PI/2