fdiv(p1)
public
Returns the floating point result of dividing fix by
numeric.
654321.fdiv(13731)
654321.fdiv(13731.24)
static VALUE
fix_fdiv(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
return DBL2NUM((double)FIX2LONG(x) / (double)FIX2LONG(y));
}
switch (TYPE(y)) {
case T_BIGNUM:
return DBL2NUM((double)FIX2LONG(x) / rb_big2dbl(y));
case T_FLOAT:
return DBL2NUM((double)FIX2LONG(x) / RFLOAT_VALUE(y));
default:
return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
}