diff --git a/mrbgems/mruby-bigint/core/bigint.c b/mrbgems/mruby-bigint/core/bigint.c index 7688943cf..437d5fc6c 100644 --- a/mrbgems/mruby-bigint/core/bigint.c +++ b/mrbgems/mruby-bigint/core/bigint.c @@ -1151,6 +1151,10 @@ mrb_bint_new_float(mrb_state *mrb, mrb_float x) /* x should not be NaN nor Infinity */ mrb_assert(x == x && x != x * 0.5); + if (FIXABLE_FLOAT(x)) { + return mrb_int_value(mrb, (mrb_int)x); + } + int sn; if (x < 0.0) { x = -x;