]> granicus.if.org Git - php/commitdiff
Fixed bug #47168 (printf of floating point variable prints maximum of 40 decimal...
authorIlia Alshanetsky <iliaa@php.net>
Fri, 19 Nov 2010 16:36:10 +0000 (16:36 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 19 Nov 2010 16:36:10 +0000 (16:36 +0000)
ext/standard/formatted_print.c
ext/standard/tests/strings/bug47168.phpt [new file with mode: 0644]

index e5359461b3dbae3a19c6dd35ca1cd564b1190251..2217c58dbe76639804e11e53a90b73f664ceb16f 100644 (file)
@@ -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 (file)
index 0000000..4cca362
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+Bug #47168 (printf of floating point variable prints maximum of 40 decimal places)
+--FILE--
+<?php
+
+$dyadic = 0.00000000000045474735088646411895751953125;
+var_dump(printf ("%1.41f\n",unserialize(serialize($dyadic))));
+
+?>
+--EXPECT--
+0.00000000000045474735088646411895751953125
+int(44)