note 49914 deleted from function.bccomp by nlopess
| From: | nlopess@php.net | Date: | Fri, 11 Feb 2005 22:12:41 +0000 |
| Subject: | note 49914 deleted from function.bccomp by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84875@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Note that the above function defeats the purpose of BCMath functions, for it uses the
'conventional' < operator.
Instead, it should be:
<?php
function my_bccomp_zero($amount, $scale)
{
if (@$amount{0}=="-")
{
return bccomp($amount, '-0.0', $scale);
}
else
{
return bccomp($amount, '0.0', $scale);
}
}
?>