summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/numeric.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 1a006b7e3..fd9f5ce2c 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -907,6 +907,7 @@ flo_round(mrb_state *mrb, mrb_value num)
mrb_check_num_exact(mrb, number);
f = 1.0;
+ if (ndigits < -DBL_DIG-2) return mrb_fixnum_value(0);
i = ndigits >= 0 ? ndigits : -ndigits;
if (ndigits > DBL_DIG+2) return num;
while (--i >= 0)