Change the num.divmod(float) to return [int,num].

This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-05-17 10:44:56 +09:00
parent 8a9f984eb8
commit bc18060149
+2 -2
View File
@@ -934,7 +934,7 @@ fix_divmod(mrb_state *mrb, mrb_value x)
mrb_value a, b;
flodivmod(mrb, (mrb_float)mrb_fixnum(x), mrb_to_flo(mrb, y), &div, &mod);
a = mrb_float_value(mrb, div);
a = mrb_int_value(mrb, div);
b = mrb_float_value(mrb, mod);
return mrb_assoc_new(mrb, a, b);
}
@@ -952,7 +952,7 @@ flo_divmod(mrb_state *mrb, mrb_value x)
mrb_get_args(mrb, "o", &y);
flodivmod(mrb, mrb_float(x), mrb_to_flo(mrb, y), &div, &mod);
a = mrb_float_value(mrb, div);
a = mrb_int_value(mrb, div);
b = mrb_float_value(mrb, mod);
return mrb_assoc_new(mrb, a, b);
}