Commit a776e3a1 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2202 from akuroda/pr_refactor_fix_mod

refactor fix_mod
parents 260d38d5 c445c6c7
......@@ -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 {
......
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