mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 15:36:59 +00:00
circumvent compiler bug
This commit is contained in:
parent
756b5a6690
commit
12b0169318
5
util.cpp
5
util.cpp
@ -426,7 +426,10 @@ bignum bignum::randomized_div(int x) const {
|
||||
for(int i=K-1; i>=0; i--) {
|
||||
carry *= BASE;
|
||||
carry += digits[i];
|
||||
tie(carry, res.digits[i]) = make_pair(carry % x, carry / x);
|
||||
// strange compiler buug:
|
||||
// if I do / and %, function 'divmod' is called, and it complains on launch that divmod is unimplemented
|
||||
res.digits[i] = carry / x;
|
||||
carry -= res.digits[i] * x;
|
||||
}
|
||||
while(isize(res.digits) && res.digits.back() == 0) res.digits.pop_back();
|
||||
if(rand() % x < carry) res += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user