diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-18 13:14:59 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:43 +0900 |
| commit | c8cf9512cd80ad3b90cb33c29056f75db5fceb0f (patch) | |
| tree | c3d1039c34dbbe48532e6c4b92d499256a563d6f | |
| parent | 1835753f9f20220065346344ca39ae34e2e41270 (diff) | |
| download | mruby-c8cf9512cd80ad3b90cb33c29056f75db5fceb0f.tar.gz mruby-c8cf9512cd80ad3b90cb33c29056f75db5fceb0f.zip | |
Update the PR #4992 to enable integer division always.
| -rw-r--r-- | src/vm.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -2312,26 +2312,13 @@ RETRY_TRY_BLOCK: /* need to check if op is overridden */ switch (TYPES2(mrb_type(regs[a]),mrb_type(regs[a+1]))) { case TYPES2(MRB_TT_FIXNUM,MRB_TT_FIXNUM): -#ifdef MRB_NO_FLOAT { mrb_int x = mrb_fixnum(regs[a]); mrb_int y = mrb_fixnum(regs[a+1]); SET_INT_VALUE(regs[a], y ? x / y : 0); } - break; -#else - #ifdef MRB_INTEGER_DIVISION - { - mrb_int x = mrb_fixnum(regs[a]); - mrb_int y = mrb_fixnum(regs[a+1]); - SET_INT_VALUE(regs[a], y ? x / y : 0); - NEXT; - } - #else - x = (mrb_float)mrb_fixnum(regs[a]); - y = (mrb_float)mrb_fixnum(regs[a+1]); - #endif - break; + NEXT; +#ifndef MRB_NO_FLOAT case TYPES2(MRB_TT_FIXNUM,MRB_TT_FLOAT): x = (mrb_float)mrb_fixnum(regs[a]); y = mrb_float(regs[a+1]); |
