#23866 [Opn->Bgs]: number_format of 0.x with notation returns -0.00
| From: | derick@php.net | Date: | Wed, 28 May 2003 21:44:31 +0000 |
| Subject: | #23866 [Opn->Bgs]: number_format of 0.x with notation returns -0.00 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40606@lists.php.net to get a copy of this message | ||
ID: 23866
Updated by: derick@php.net
Reported By: david at ewebdevelopers dot com
-Status: Open
+Status: Bogus
Bug Type: Math related
Operating System: windows 2000
PHP Version: 4.3.1
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
there is, -0.0000000000000000001E-999 is about -0. Floating points are
never precise, -0 is therefore possible.
Previous Comments:
------------------------------------------------------------------------
[2003-05-28 16:41:56] david at ewebdevelopers dot com
$num = -1.3322676295502E-015;
echo number_format($num, 2, '.', ',');
if(((float) number_format(($num, 2,'.', ',')) == 0){
echo 'true';
}
number_format should not evaluate to -0.00
should evaluate to 0.00 because there is no such thing as -0;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23866&edit=1