From: Ilia Alshanetsky Date: Fri, 19 Nov 2010 16:36:10 +0000 (+0000) Subject: Fixed bug #47168 (printf of floating point variable prints maximum of 40 decimal... X-Git-Tag: php-5.3.4RC2~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8b4724747419f0508c5317f3cc9cf913d6f7dc5;p=php Fixed bug #47168 (printf of floating point variable prints maximum of 40 decimal places). --- diff --git a/NEWS b/NEWS index 4e6606a0e5..2e74013c80 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2010, PHP 5.3.4 +- Fixed bug #47168 (printf of floating point variable prints maximum of 40 + decimal places). (Ilia) 18 Nov 2010, PHP 5.3.4RC1 - Upgraded bundled Sqlite3 to version 3.7.3. (Ilia) diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index e5359461b3..2217c58dbe 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -41,7 +41,7 @@ #define FLOAT_DIGITS 6 #define FLOAT_PRECISION 6 #define MAX_FLOAT_DIGITS 38 -#define MAX_FLOAT_PRECISION 40 +#define MAX_FLOAT_PRECISION 53 #if 0 /* trick to control varargs functions through cpp */ diff --git a/ext/standard/tests/strings/bug47168.phpt b/ext/standard/tests/strings/bug47168.phpt new file mode 100644 index 0000000000..4cca362569 --- /dev/null +++ b/ext/standard/tests/strings/bug47168.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #47168 (printf of floating point variable prints maximum of 40 decimal places) +--FILE-- + +--EXPECT-- +0.00000000000045474735088646411895751953125 +int(44)