diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index fc46f1c5054b9..20f30071fac47 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -92,7 +92,7 @@ static char *php_convert_to_decimal(double arg, int ndigits, int *decpt, int *si while (p1 < &cvt_buf[NDIG]) *p++ = *p1++; } else if (arg > 0) { - while ((fj = arg * 10) < 1) { + while ((fj = arg * 10.0) < 0.9999999) { arg = fj; r2--; }