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

parent 6f67fddb
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment