Fix `int_quo` to do float division; fix #5268

parent c7452ff6
......@@ -177,9 +177,15 @@ int_quo(mrb_state *mrb, mrb_value xv)
if (y == 0) {
int_zerodiv(mrb);
}
return mrb_fixnum_value(mrb_fixnum(xv) / y);
return mrb_fixnum_value(mrb_integer(xv) / y);
#else
return int_div(mrb, xv);
mrb_float y;
mrb_get_args(mrb, "f", &y);
if (y == 0) {
int_zerodiv(mrb);
}
return mrb_float_value(mrb, mrb_integer(xv) / y);
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment