diff options
Diffstat (limited to 'test/test_utils.hpp')
-rw-r--r-- | test/test_utils.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_utils.hpp b/test/test_utils.hpp index 5f4c03f..cc9c1f8 100644 --- a/test/test_utils.hpp +++ b/test/test_utils.hpp @@ -44,7 +44,7 @@ static inline size_t rand_between(Context& ctx, const size_t min, const size_t max) { assert(max >= min); - const size_t r = (max == min) ? min : ctx.dist(ctx.rng) % (max - min) + min; + const size_t r = (max == min) ? min : (ctx.dist(ctx.rng) % (max - min)) + min; assert(r >= min && r < max); return r; } @@ -58,7 +58,7 @@ make_random_precisions(Context& ctx) size_t bits_left = N; for (size_t i = 0; i < D; ++i) { - ms[i] = rand_between(ctx, 1, std::min(Max, bits_left / (D - i) + 1)); + ms[i] = rand_between(ctx, 1, std::min(Max, (bits_left / (D - i)) + 1)); bits_left -= ms[i]; } |