/(p1)
public
Returns a new float which is the result of dividing float by other.
Show source
static VALUE
flo_div(VALUE x, VALUE y)
{
long f_y;
double d;
switch (TYPE(y)) {
case T_FIXNUM:
f_y = FIX2LONG(y);
return DBL2NUM(RFLOAT_VALUE(x) / (double)f_y);
case T_BIGNUM:
d = rb_big2dbl(y);
return DBL2NUM(RFLOAT_VALUE(x) / d);
case T_FLOAT:
return DBL2NUM(RFLOAT_VALUE(x) / RFLOAT_VALUE(y));
default:
return rb_num_coerce_bin(x, y, '/');
}
}