/*
* 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(VALUE x, VALUE y)
{
long f_y;
double d;
switch (TYPE(y)) {
case T_FIXNUM:
f_y = FIX2LONG(y);
return DOUBLE2NUM(RFLOAT_VALUE(x) / (double)f_y);
case T_BIGNUM:
d = rb_big2dbl(y);
return DOUBLE2NUM(RFLOAT_VALUE(x) / d);
case T_FLOAT:
return DOUBLE2NUM(RFLOAT_VALUE(x) / RFLOAT_VALUE(y));
default:
return rb_num_coerce_bin(x, y, '/');
}
}