twacube: fix bug in swarming for large formulae

This bug is similar to the one described in  commit
d956fdc385b4dd9a5c5b3a63a0de80a09eb8e40d.

* spot/twacube/twacube.hh: Here.
This commit is contained in:
Etienne Renault 2019-07-25 15:48:08 +02:00
parent 276892229c
commit 87afcd2f87

View file

@ -112,8 +112,10 @@ namespace spot
// precomputed primes and seed access one of this primes. Note
// that the chosen prime must be greater than n.
SPOT_ASSERT(primes[seed] > (st_.succ_tail-st_.succ+1));
return (((idx_-st_.succ+1)*primes[seed]) % (st_.succ_tail-st_.succ+1))
+ st_.succ;
unsigned long long c = (idx_-st_.succ) + 1;
unsigned long long p = primes[seed];
unsigned long long s = (st_.succ_tail-st_.succ+1);
return (unsigned) (((c*p) % s)+st_.succ);
}
private: