mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
BigInteger: fix special case for base-10 / bcmath
echo new Math_BigInteger('-') when in bcmath mode would output '-' - not '0'
This commit is contained in:
parent
4e06ab52dd
commit
42f22a4e44
@ -425,7 +425,7 @@ class Math_BigInteger {
|
||||
case MATH_BIGINTEGER_MODE_BCMATH:
|
||||
// explicitly casting $x to a string is necessary, here, since doing $x[0] on -1 yields different
|
||||
// results then doing it on '-1' does (modInverse does $x[0])
|
||||
$this->value = (string) $x;
|
||||
$this->value = $x === '-' ? '0' : (string) $x;
|
||||
break;
|
||||
default:
|
||||
$temp = new Math_BigInteger();
|
||||
|
Loading…
Reference in New Issue
Block a user