From:             nat at fishtrap dot co dot uk
Operating system: Linux
PHP version:      5.2CVS-2008-05-14 (snap)
PHP Bug Type:     BC math related
Bug description:  bcpowmod using a scale function always returns 0

Description:
------------
When using the 4th optional parameter of bcpowmod. The answer is always
zero and does not match the answer using bc directly.

This is also true if you set the scale using bcscale(1).

In short if the scale is non zero I can't find any way of getting anything
apart from zero as the result.

Reproduce code:
---------------
echo bcpowmod("4", "4", "3", 1 ) ,PHP_EOL;



Expected result:
----------------
0.1

in bc
scale =1;
4^4%3;
.1

Actual result:
--------------
0.0

-- 
Edit bug report at http://bugs.php.net/?id=44995&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44995&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44995&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44995&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44995&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44995&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44995&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44995&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44995&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44995&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44995&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44995&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44995&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44995&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44995&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44995&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44995&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44995&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44995&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44995&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44995&r=mysqlcfg

Reply via email to