mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #6794 from mattn/fix/readfloat-18-digits
This commit is contained in:
+1
-1
@@ -144,7 +144,7 @@ mrb_read_float(const char *str, char **endp, double *fp)
|
||||
// Parse fractional part
|
||||
if (*p == '.') {
|
||||
p++;
|
||||
while (ISDIGIT(*p) && frac_digits < 17) { // Limit precision to avoid overflow
|
||||
while (ISDIGIT(*p) && frac_digits < 18) { // Limit precision to avoid overflow
|
||||
frac_part = frac_part * 10 + (*p - '0');
|
||||
frac_digits++;
|
||||
digits++;
|
||||
|
||||
Reference in New Issue
Block a user