numeric.c (mrb_div_int): separate the function in two.

- mrb_div_int() does integer division in Ruby way (mdiv)
  returns mrb_int
- mrb_div_int_value() division with zero div and overflow checks.
  returns mrb_value
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-07-09 14:38:18 +09:00
parent f1275803c9
commit e1980d7596
4 changed files with 21 additions and 21 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ mrb_irep_catch_handler_table(const struct mrb_irep *irep)
#endif
/* numeric */
mrb_int mrb_div_int(mrb_state *mrb, mrb_int x, mrb_int y);
mrb_value mrb_div_int_value(mrb_state *mrb, mrb_int x, mrb_int y);
mrb_int mrb_div_int(mrb_int x, mrb_int y);
mrb_value mrb_int_add(mrb_state *mrb, mrb_value x, mrb_value y);
mrb_value mrb_int_sub(mrb_state *mrb, mrb_value x, mrb_value y);
mrb_value mrb_int_mul(mrb_state *mrb, mrb_value x, mrb_value y);