#33549 [NEW]: Wrong result with bcmul()
| From: | a dot schilder at gmx dot de | Date: | Sat, 02 Jul 2005 16:03:13 +0000 |
| Subject: | #33549 [NEW]: Wrong result with bcmul() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-81305@lists.php.net to get a copy of this message | ||
From: a dot schilder at gmx dot de
Operating system: Win XP SP2
PHP version: 5.0.4
PHP Bug Type: BC math related
Bug description: Wrong result with bcmul()
Description:
------------
The result returned by bcmul() with the factor X (greater than 0) and
0.00001 is 0 - it's not the expected result.
Reproduce code:
---------------
// Does not work - result is 0:
bcmul(1, 0.00001, 5);
// This workaround does it - result 0.00001:
bcdiv(bcmul(1, 0.00010, 5), 10, 5);
Expected result:
----------------
The correct result 0.00001
Actual result:
--------------
0
--
Edit bug report at http://bugs.php.net/?id=33549&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33549&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33549&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33549&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33549&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33549&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33549&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33549&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33549&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33549&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33549&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33549&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33549&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33549&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33549&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33549&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33549&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33549&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33549&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33549&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33549&r=mysqlcfg