Bug #54598 [Opn->Ana]: bcpowmod() may return 1 if modulus is 1
| From: | cmb@php.net | Date: | Wed, 06 Sep 2017 22:06:20 +0000 |
| Subject: | Bug #54598 [Opn->Ana]: bcpowmod() may return 1 if modulus is 1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210978@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54598&edit=1
ID: 54598
Updated by: cmb@php.net
Reported by: okano1220 at gmail dot com
-Summary: when exp is 0 ,bcpowmod returns 1 ,even if modulous
is 1
+Summary: bcpowmod() may return 1 if modulus is 1
-Status: Open
+Status: Analyzed
Type: Bug
Package: BC math related
Operating System: linux,windows
PHP Version: 5.3.6
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks for reporting this issue and providing an appropriate
patch!
And sorry for the long delay!
Previous Comments:
------------------------------------------------------------------------
[2011-04-24 16:15:50] okano1220 at gmail dot com
Description:
------------
when setting bcpowmod 2nd parameter $right_operand to 0 and setting 3rd parameter $modulous to 1,
bcpowmod returns 1.
Ofcourse expected value is 0.
Test script:
---------------
<?php echo bcpomod(5,0,1); // 5**0%1
Expected result:
----------------
0
Actual result:
--------------
1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54598&edit=1