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 unused_obj, VALUE x)
{
double d;
d = Get_Double(x);
/* check for domain error */
if (d < -1.0 || 1.0 < d) domain_error("acos");
return DBL2NUM(acos(d));
}