mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 10:15:14 +00:00
BigInteger: fix issues with divide method
This commit is contained in:
parent
d0014cbb20
commit
5e9d05a9f4
@ -1586,7 +1586,9 @@ class Math_BigInteger
|
|||||||
$temp_value = array($quotient_value[$q_index]);
|
$temp_value = array($quotient_value[$q_index]);
|
||||||
$temp = $temp->multiply($y);
|
$temp = $temp->multiply($y);
|
||||||
$temp_value = &$temp->value;
|
$temp_value = &$temp->value;
|
||||||
|
if ($temp_value !== []) {
|
||||||
$temp_value = array_merge($adjust, $temp_value);
|
$temp_value = array_merge($adjust, $temp_value);
|
||||||
|
}
|
||||||
|
|
||||||
$x = $x->subtract($temp);
|
$x = $x->subtract($temp);
|
||||||
|
|
||||||
@ -3628,6 +3630,7 @@ class Math_BigInteger
|
|||||||
$value = &$result->value;
|
$value = &$result->value;
|
||||||
|
|
||||||
if (!count($value)) {
|
if (!count($value)) {
|
||||||
|
$result->is_negative = false;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user