diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-07-20 02:57:36 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-07-22 13:23:53 +0900 |
| commit | 277be410f31efc1dfa6e2d4bcc56b9c21b300bc6 (patch) | |
| tree | 56e6da1c3809151257a59756415592592d9b3729 /src/numeric.c | |
| parent | 6f67fddb87bc1bb098431fa23cbf39f5fedea43e (diff) | |
| download | mruby-277be410f31efc1dfa6e2d4bcc56b9c21b300bc6.tar.gz mruby-277be410f31efc1dfa6e2d4bcc56b9c21b300bc6.zip | |
No rounding needed if 'ndigits` is bigger than `DBL_DIG+2`; fix #4566
Diffstat (limited to 'src/numeric.c')
| -rw-r--r-- | src/numeric.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/numeric.c b/src/numeric.c index 4288df44a..a1299a74f 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -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; |
