mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
numeric.c: the result of -5.div(2) should be -3 as CRuby does.
This commit is contained in:
+1
-4
@@ -166,10 +166,7 @@ int_idiv(mrb_state *mrb, mrb_value x)
|
||||
mrb_int y;
|
||||
|
||||
mrb_get_args(mrb, "i", &y);
|
||||
if (y == 0) {
|
||||
mrb_int_zerodiv(mrb);
|
||||
}
|
||||
return mrb_int_value(mrb, mrb_integer(x) / y);
|
||||
return mrb_int_value(mrb, mrb_div_int(mrb, mrb_integer(x), y));
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
|
||||
Reference in New Issue
Block a user