static public Method

Math.cos(p1)

Math.cos(x)     float

Computes the cosine of x (expressed in radians). Returns -1..1.

Source Code

/*
*  call-seq:
*     Math.cos(x)    => float
*  
*  Computes the cosine of <i>x</i> (expressed in radians). Returns
*  -1..1.
*/

static VALUE
math_cos(obj, x)
   VALUE obj, x;
{
   Need_Float(x);
   return rb_float_new(cos(RFLOAT(x)->value));
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.