diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-05-17 10:44:56 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-05-17 10:58:17 +0900 |
| commit | bc18060149fae9121fe744544521ca58989010ae (patch) | |
| tree | 9d408abb1961d01615ea771cfc897471d6f42a1c | |
| parent | 8a9f984eb8771a3d4956783116f972d4f5f70dfd (diff) | |
| download | mruby-bc18060149fae9121fe744544521ca58989010ae.tar.gz mruby-bc18060149fae9121fe744544521ca58989010ae.zip | |
Change the `num.divmod(float)` to return `[int,num]`.
| -rw-r--r-- | src/numeric.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/numeric.c b/src/numeric.c index 30b6b230e..ab8771e1a 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -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); } |
