Index: Zend/zend_strtod.c =================================================================== RCS file: /repository/ZendEngine2/zend_strtod.c,v retrieving revision 1.37 diff -u -r1.37 zend_strtod.c --- Zend/zend_strtod.c 26 Mar 2008 14:23:02 -0000 1.37 +++ Zend/zend_strtod.c 18 Apr 2008 01:22:29 -0000 @@ -1732,14 +1732,7 @@ if (value(d) > 0.5 + value(eps)) goto bump_up; else if (value(d) < 0.5 - value(eps)) { - /* cut ALL traling zeros only if the number of chars is greater than precision - * otherwise cut only extra zeros - */ - if (k < ndigits) { - while(*--s == '0' && (s - s0) > k); - } else { - while(*--s == '0'); - } + while(*--s == '0'); s++; goto ret1; } Index: main/snprintf.c =================================================================== RCS file: /repository/php-src/main/snprintf.c,v retrieving revision 1.63 diff -u -r1.63 snprintf.c --- main/snprintf.c 7 Feb 2008 18:40:29 -0000 1.63 +++ main/snprintf.c 18 Apr 2008 01:22:37 -0000 @@ -152,9 +152,7 @@ *dst++ = '-'; } - for (i = 0; i < ndigit && digits[i] != '\0'; i++); - - if ((decpt >= 0 && decpt - i > 4) || (decpt < 0 && decpt < -3)) { /* use E-style */ + if ((decpt >= 0 && decpt > ndigit) || decpt < -3) { /* use E-style */ /* exponential format (e.g. 1.2345e+13) */ if (--decpt < 0) { sign = 1; Index: Zend/tests/hex_overflow_32bit.phpt =================================================================== RCS file: /repository/ZendEngine2/tests/hex_overflow_32bit.phpt,v retrieving revision 1.2 diff -u -r1.2 hex_overflow_32bit.phpt --- Zend/tests/hex_overflow_32bit.phpt 26 Apr 2007 23:32:30 -0000 1.2 +++ Zend/tests/hex_overflow_32bit.phpt 18 Apr 2008 01:22:30 -0000 @@ -22,7 +22,7 @@ echo "Done\n"; ?> --EXPECTF-- -float(4083360297110%d) +float(4.0833602971%dE+14) float(4.7223664828%dE+21) float(1.3521606402%dE+31) float(1.9807040628%dE+27) Index: Zend/tests/zend_strtod.phpt =================================================================== RCS file: /repository/ZendEngine2/tests/zend_strtod.phpt,v retrieving revision 1.3 diff -u -r1.3 zend_strtod.phpt --- Zend/tests/zend_strtod.phpt 1 Mar 2006 17:20:28 -0000 1.3 +++ Zend/tests/zend_strtod.phpt 18 Apr 2008 01:22:30 -0000 @@ -15,5 +15,5 @@ float(-100) float(808792757210) float(-4.5646456464565E+27) -float(-11276204760067000) +float(-1.1276204760067E+16) Done Index: ext/standard/tests/general_functions/008.phpt =================================================================== RCS file: /repository/php-src/ext/standard/tests/general_functions/008.phpt,v retrieving revision 1.3 diff -u -r1.3 008.phpt --- ext/standard/tests/general_functions/008.phpt 17 Jan 2006 12:18:53 -0000 1.3 +++ ext/standard/tests/general_functions/008.phpt 18 Apr 2008 01:22:36 -0000 @@ -34,7 +34,7 @@ [11]=> float(123456789012) [12]=> - float(1234567890120) + float(1.23456789012E+12) [13]=> float(1.23456789012E+19) } Index: ext/standard/tests/strings/printf.phpt =================================================================== RCS file: /repository/php-src/ext/standard/tests/strings/printf.phpt,v retrieving revision 1.5 diff -u -r1.5 printf.phpt --- ext/standard/tests/strings/printf.phpt 26 Apr 2007 23:42:36 -0000 1.5 +++ ext/standard/tests/strings/printf.phpt 18 Apr 2008 01:22:36 -0000 @@ -645,10 +645,10 @@ -123456 123456 -123456 -120000 --120000 -+120000 --120000 +1.2e+5 +-1.2e+5 ++1.2e+5 +-1.2e+5 123456 -123456 1.0E+5 @@ -657,10 +657,10 @@ -123456 123456 -123456 -120000 --120000 -+120000 --120000 +1.2E+5 +-1.2E+5 ++1.2E+5 +-1.2E+5 *** Output for '%%%.2f' as the format parameter *** %12345678900.00