mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-21 08:00:25 +00:00
fixed incorrect computation in bignum
This commit is contained in:
parent
64ad97cf2f
commit
2c63d4869f
@ -37,7 +37,7 @@ void bignum::addmul(const bignum& b, int factor) {
|
|||||||
int K = isize(b.digits);
|
int K = isize(b.digits);
|
||||||
if(K > isize(digits)) digits.resize(K);
|
if(K > isize(digits)) digits.resize(K);
|
||||||
int carry = 0;
|
int carry = 0;
|
||||||
for(int i=0; i<K || (carry > 0 && carry < -1) || (carry == -1 && i < isize(digits)); i++) {
|
for(int i=0; i<K || (carry > 0 || carry < -1) || (carry == -1 && i < isize(digits)); i++) {
|
||||||
if(i >= isize(digits)) digits.push_back(0);
|
if(i >= isize(digits)) digits.push_back(0);
|
||||||
long long l = digits[i];
|
long long l = digits[i];
|
||||||
l += carry;
|
l += carry;
|
||||||
|
Loading…
Reference in New Issue
Block a user