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.4.0alpha1~191^2~631 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bdb47791aabb732b8ebae8ecb73acea8f7d2ed3;p=php Fixed bug #47168 (printf of floating point variable prints maximum of 40 decimal places). --- 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)