Add range check before casting float to integer.
MODIFY
src/numeric.c
src/numeric.c
@@ -853,6 +853,8 @@ flo_round(mrb_state *mrb, mrb_value num)
if (!isfinite(number)) return num;
return mrb_float_value(mrb, number);
}
+ if (!FIXABLE_FLOAT(number))
+ return mrb_float_value(mrb, number);
return mrb_int_value(mrb, (mrb_int)number);
}

Add range check before casting float to integer.