/(p1)
public
Returns a new float which is the result of dividing float by other.
Show source
/*
* call-seq:
* float / other => float
*
* Returns a new float which is the result of dividing
* <code>float</code> by <code>other</code>.
*/
static VALUE
flo_div(x, y)
VALUE x, y;
{
long f_y;
double d;
switch (TYPE(y)) {
case T_FIXNUM:
f_y = FIX2LONG(y);
return rb_float_new(RFLOAT(x)->value / (double)f_y);
case T_BIGNUM:
d = rb_big2dbl(y);
return rb_float_new(RFLOAT(x)->value / d);
case T_FLOAT:
return rb_float_new(RFLOAT(x)->value / RFLOAT(y)->value);
default:
return rb_num_coerce_bin(x, y);
}
}