mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
No rounding needed if 'ndigits is bigger than DBL_DIG+2`; fix #4566
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user