From 5bdb47791aabb732b8ebae8ecb73acea8f7d2ed3 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 19 Nov 2010 16:36:10 +0000 Subject: [PATCH] Fixed bug #47168 (printf of floating point variable prints maximum of 40 decimal places). --- ext/standard/formatted_print.c | 2 +- ext/standard/tests/strings/bug47168.phpt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/strings/bug47168.phpt 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) -- 2.40.0