note 9309 added to bcmul
| From: | chris dot key at wcom dot com | Date: | Fri, 27 Oct 2000 10:25:23 +0000 |
| Subject: | note 9309 added to bcmul | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7056@lists.php.net to get a copy of this message | ||
bcmul optional scale parameter is not optional. Given the following code:
echo "A: ".(2900000 / 500)."\n";
echo "C: ".bcdiv( (290000 / 500), 290000, 5). "\n";
echo "K: ".bcmul( bcdiv( (290000 / 500), 290000, 5), 290000,3)."\n";
echo "ACK: ". bcmul( bcdiv( (290000 / 500), 290000, 5), 2900000);
Should yield:
A: 646.654
C: 0.00200
K: 646.654
ACK: 646
But instead gives:
A: 646.654
C: 0.00200
K: 646.654
ACK: 0
Even if there is an integer portion of the result, it will return 0 unless the scale parameter is
set to the number of non-zero digits after the decimal.
http://www.php.net/manual/function.bcmul.php