Merge pull request #6794 from mattn/fix/readfloat-18-digits

This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-04-18 08:27:58 +09:00
committed by GitHub
+1 -1
View File
@@ -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++;