|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-01-21 20:01 UTC] [email protected]
[2011-04-16 21:00 UTC] testify4 at o2 dot pl
[2017-09-11 15:16 UTC] [email protected]
-Status: Not a bug
+Status: Re-Opened
-Assigned To:
+Assigned To: cmb
[2017-09-11 15:16 UTC] [email protected]
[2017-09-11 22:03 UTC] [email protected]
[2017-09-11 22:03 UTC] [email protected]
-Status: Re-Opened
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Mar 17 12:00:01 2026 UTC |
Description: ------------ bcadd("-0.0", "-0.0", 1); // returns -0.0 bccomp("-0.0", "0", 1); // returns -1 I believe that the first expression should return '0.0', and the second one should return 0. The second expression implies that "-0.0" is mathematically less than "0", which is incorrect. -- I also submitted another bug related to minus zero. echo -0.1 * 0; // returns -0 -- Reproduce code: --------------- <?php echo bcadd("-0.0", "-0.0", 1) . "<br>\n"; // returns -0.0 echo bccomp("-0.0", "0", 1) . "<br>\n"; // returns -1 ?> Expected result: ---------------- -0.0 -1 Actual result: -------------- 0.0 0