diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-06 00:11:16 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-06 00:11:16 +0900 |
| commit | a776e3a1ebbb7907c5699656531e47fe4a144a88 (patch) | |
| tree | 86b92cd14b092c429abcd238ac91efee185c45ea | |
| parent | 260d38d5ee5228bcfae1a834357ed58bbb96ea80 (diff) | |
| parent | c445c6c7da154e26a0f2bb7c8c958d52c1eb44d8 (diff) | |
| download | mruby-a776e3a1ebbb7907c5699656531e47fe4a144a88.tar.gz mruby-a776e3a1ebbb7907c5699656531e47fe4a144a88.zip | |
Merge pull request #2202 from akuroda/pr_refactor_fix_mod
refactor fix_mod
| -rw-r--r-- | src/numeric.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/numeric.c b/src/numeric.c index 7b025c34d..357e9438e 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -774,17 +774,17 @@ static mrb_value fix_mod(mrb_state *mrb, mrb_value x) { mrb_value y; - mrb_int a, b; + mrb_int a; mrb_get_args(mrb, "o", &y); a = mrb_fixnum(x); - if (mrb_fixnum_p(y) && (b=mrb_fixnum(y)) != 0) { - mrb_int mod; + if (mrb_fixnum_p(y)) { + mrb_int b, mod; - if (mrb_fixnum(y) == 0) { + if ((b=mrb_fixnum(y)) == 0) { return mrb_float_value(mrb, NAN); } - fixdivmod(mrb, a, mrb_fixnum(y), 0, &mod); + fixdivmod(mrb, a, b, 0, &mod); return mrb_fixnum_value(mod); } else { |
