php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4974 error in handling garbage value..
Submitted: 2000-06-12 11:17 UTC Modified: 2000-06-12 11:21 UTC
From: refract at dreamwiz dot com Assigned:
Status: Closed Package: Other
PHP Version: 4.0.0 Release OS: Windows2000
Private report: No CVE-ID: None
 [2000-06-12 11:17 UTC] refract at dreamwiz dot com
echo "echo (0.04-0.03-0.01); ===>";
echo (0.04-0.03-0.01);
echo "<BR>\n";
echo "echo (0.03-0.01-0.01-0.01); ===>";
echo (0.03-0.01-0.01-0.01);
echo "<BR>\n";
-------------------------------------------
output

echo (0.04-0.03-0.01); ===>1.7347234759768E-018
echo (0.03-0.01-0.01-0.01); ===>-3.4694469519536E-018
-------------------------------------------
This bug was reported in PHP 3.0 ...
but, still exist in PHP 4.0


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-12 11:21 UTC] stas at cvs dot php dot net
this is not a bug, this is how computers handle floating point numbers.
There's no "equals" in computer floating point numbers. Everything is "more or less close to".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC