#19189 [Opn->Bgs]: sprintf yields wrong result
| From: | sander@php.net | Date: | Fri, 30 Aug 2002 07:32:52 +0000 |
| Subject: | #19189 [Opn->Bgs]: sprintf yields wrong result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18219@lists.php.net to get a copy of this message | ||
ID: 19189
Updated by: sander@php.net
Reported By: gwenzel@emb.de
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Linux Suse 7.1
PHP Version: 4.2.0
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Use the bcmath extension to avoid problems like these.
Previous Comments:
------------------------------------------------------------------------
[2002-08-30 03:20:42] gwenzel@emb.de
echo ( sprintf("%012d", 68.85*100 ) );
yields
000000006884
Strangly enough:
echo ( sprintf("%012d", 68.95*100 ) );
yields the correct result:
000000006895
'./configure' '--with-apxs=/usr/local/apache/bin/apxs'
'--enable-trans-sid' '--with-mysql' '--enable-ftp'
'--with-config-file-path=/www/conf' '--with-zlib-dir=/usr/local'
'--with-gd=/usr/local' '--with-png-dir=/usr/local'
'--with-jpeg-dir=/usr/local' '--with-freetype-dir=/usr/local'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19189&edit=1