No rounding needed if 'ndigits is bigger than DBL_DIG+2`; fix #4566

This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-07-20 02:57:36 +09:00
parent 6f67fddb87
commit 277be410f3
+1
View File
@@ -702,6 +702,7 @@ flo_round(mrb_state *mrb, mrb_value num)
f = 1.0;
i = ndigits >= 0 ? ndigits : -ndigits;
if (ndigits > DBL_DIG+2) return num;
while (--i >= 0)
f = f*10.0;