aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_utils.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-02-10 19:35:43 -0500
committerDavid Robillard <d@drobilla.net>2025-02-10 19:35:43 -0500
commitd466d59fab9086bafeb8c5d3208580a639b6bdbf (patch)
tree4c34d574b29110c6dbe2e8e82e89e28d8bd8cc9d /test/test_utils.hpp
parentd4d7c64a7b03093d62fca36a0b73c550d69d8a94 (diff)
downloadchilbert-d466d59fab9086bafeb8c5d3208580a639b6bdbf.tar.gz
chilbert-d466d59fab9086bafeb8c5d3208580a639b6bdbf.tar.bz2
chilbert-d466d59fab9086bafeb8c5d3208580a639b6bdbf.zip
Fully parenthesize expressions
Diffstat (limited to 'test/test_utils.hpp')
-rw-r--r--test/test_utils.hpp4
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];
}