acos(p1)
public
Computes the arc cosine of x. Returns 0..PI.
Domain: [-1, 1]
Codomain: [0, PI]
Math.acos(0) == Math::PI/2
Show source
static VALUE
math_acos(VALUE obj, VALUE x)
{
double d0, d;
Need_Float(x);
d0 = RFLOAT_VALUE(x);
/* check for domain error */
if (d0 < -1.0 || 1.0 < d0) domain_error("acos");
d = acos(d0);
return DBL2NUM(d);
}