#36008 [Fbk->Opn]: incorrect round() & number_format() result
| From: | adi at rogers dot com | Date: | Wed, 14 Jun 2006 22:11:54 +0000 |
| Subject: | #36008 [Fbk->Opn]: incorrect round() & number_format() result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98378@lists.php.net to get a copy of this message | ||
ID: 36008
User updated by: adi at rogers dot com
Reported By: adi at rogers dot com
-Status: Feedback
+Status: Open
Bug Type: Math related
Operating System: win32 only
PHP Version: 5.1.2
New Comment:
Regretfully, the same output:
5.2.0-dev
Wrong: 14.37
Wrong: 14.37
'Magically' correct: 14.38
'Magically' correct: 14.38
Converted to string and is now correct: 14.38
Converted to string and is now correct: 14.38
The 32 precision results are also the same [as the ones on January 15].
Previous Comments:
------------------------------------------------------------------------
[2006-06-14 15:50:08] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-01-15 06:40:25] adi at rogers dot com
Oh, and as I had suspected, here is the value of $num with 32
precision: 14.374999999999998
With 12 as the precision, it is: 14.375
------------------------------------------------------------------------
[2006-01-15 06:34:25] adi at rogers dot com
As requested, the exact output with 32 as the precision:
Wrong: 14.369999999999999
Wrong: 14.37
'Magically' correct: 14.380000000000001
'Magically' correct: 14.38
Converted to string and is now correct: 14.369999999999999
Converted to string and is now correct: 14.37
------------------------------------------------------------------------
[2006-01-14 16:06:25] sniper@php.net
What EXACTLY is the output when you set precision to 32?
------------------------------------------------------------------------
[2006-01-14 15:55:07] adi at rogers dot com
I just confirmed this issue to still exist on the following systems:
Windows XP Pro SP2 [IIS 5.1 ISAPI] (PHP 5.1.2 / php.ini precision: 12)
Windows XP Pro SP2 [IIS 5.1 CGI] (PHP 5.1.0RC1 / php.ini precision:
12)
Windows Server 2003 Enterprise x64 Edition SP1 [IIS 6.0 CGI] (PHP 5.1.2
/ php.ini precision: 12)
PHP was installed on all three systems manually (not using the
installer).
Hope that helps in isolating this issue.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36008
--
Edit this bug report at http://bugs.php.net/?id=36008&edit=1