1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 23:50:27 +00:00

fixed incorrect computation in bignum

This commit is contained in:
Zeno Rogue 2019-08-06 21:03:51 +02:00
parent 64ad97cf2f
commit 2c63d4869f

View File

@ -37,7 +37,7 @@ void bignum::addmul(const bignum& b, int factor) {
int K = isize(b.digits);
if(K > isize(digits)) digits.resize(K);
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);
long long l = digits[i];
l += carry;