mirror of
https://github.com/php/php-src.git
synced 2025-01-19 02:03:47 +08:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fixed bug #44995 (bcpowmod() fails if scale != 0)
This commit is contained in:
commit
5ce744091c
3
NEWS
3
NEWS
@ -6,6 +6,9 @@ PHP NEWS
|
||||
. Fixed Bug #75142 (buildcheck.sh check for autoconf version needs to be updated
|
||||
for v2.64). (zizzy at zizzy dot net, Remi)
|
||||
|
||||
- BCMath:
|
||||
. Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #70470 (Built-in server truncates headers spanning over TCP
|
||||
packets). (bouk)
|
||||
|
@ -59,7 +59,7 @@ bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
|
||||
bc_init_num(&temp);
|
||||
|
||||
/* Calculate it. */
|
||||
bc_divide (num1, num2, &temp, scale);
|
||||
bc_divide (num1, num2, &temp, 0);
|
||||
if (quot)
|
||||
quotient = bc_copy_num (temp);
|
||||
bc_multiply (temp, num2, &temp, rscale);
|
||||
|
16
ext/bcmath/tests/bug44995.phpt
Normal file
16
ext/bcmath/tests/bug44995.phpt
Normal file
@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #44995 (bcpowmod() fails if scale != 0)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(bcpowmod('4', '4', '3', 1));
|
||||
var_dump(bcpowmod('3234', '32345', '22345', 1));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(3) "1.0"
|
||||
string(7) "17334.0"
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user