quo(p1)
public
Returns most exact division (rational for integers, float for floats).
Show source
static VALUE
numeric_quo(VALUE x, VALUE y)
{
if (RB_TYPE_P(y, T_FLOAT)) {
return f_fdiv(x, y);
}
if (canonicalization) {
x = rb_rational_raw1(x);
}
else
{
x = rb_convert_type(x, T_RATIONAL, "Rational", "to_r");
}
return rb_funcall(x, '/', 1, y);
}