sqrt(p1)
public
Returns the non-negative square root of numeric.
Show source
/*
* call-seq:
* Math.sqrt(numeric) => float
*
* Returns the non-negative square root of <i>numeric</i>.
*/
static VALUE
math_sqrt(obj, x)
VALUE obj, x;
{
double d;
Need_Float(x);
errno = 0;
d = sqrt(RFLOAT(x)->value);
domain_check(d, "sqrt");
return rb_float_new(d);
}