diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-26 15:48:50 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-26 15:48:50 +0900 |
| commit | 7d5cf8749a439f247b05f84a459f0da1f2045cb8 (patch) | |
| tree | 52021b3b099166a4f47a7511ff3816fc74d9e80a /src/numeric.c | |
| parent | 46ab8fdf078e6f2351d412c04d733ea5d727ef70 (diff) | |
| download | mruby-7d5cf8749a439f247b05f84a459f0da1f2045cb8.tar.gz mruby-7d5cf8749a439f247b05f84a459f0da1f2045cb8.zip | |
`(0).div(0.0)` should be NaN; fix #3754
Diffstat (limited to 'src/numeric.c')
| -rw-r--r-- | src/numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c index c7f3002d8..be71f1185 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -829,7 +829,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, (mrb_int)div); + a = mrb_float_value(mrb, div); b = mrb_float_value(mrb, mod); return mrb_assoc_new(mrb, a, b); } |
