floor()
public
Returns the largest integer less than or equal to flt.
1.2.floor
2.0.floor
(-1.2).floor
(-2.0).floor
Show source
/*
* call-seq:
* flt.floor => integer
*
* Returns the largest integer less than or equal to <i>flt</i>.
*
* 1.2.floor
* 2.0.floor
* (-1.2).floor
* (-2.0).floor
*/
static VALUE
flo_floor(num)
VALUE num;
{
double f = floor(RFLOAT(num)->value);
long val;
if (!FIXABLE(f)) {
return rb_dbl2big(f);
}
val = f;
return LONG2FIX(val);
}