From 87afcd2f874c5f4c31e28996fe55dfae38d68f12 Mon Sep 17 00:00:00 2001 From: Etienne Renault Date: Thu, 25 Jul 2019 15:48:08 +0200 Subject: [PATCH] twacube: fix bug in swarming for large formulae This bug is similar to the one described in commit d956fdc385b4dd9a5c5b3a63a0de80a09eb8e40d. * spot/twacube/twacube.hh: Here. --- spot/twacube/twacube.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spot/twacube/twacube.hh b/spot/twacube/twacube.hh index 0769b3e09..1a8112a84 100644 --- a/spot/twacube/twacube.hh +++ b/spot/twacube/twacube.hh @@ -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: