Skip to content

Commit

Permalink
Fix -Wconversion
Browse files Browse the repository at this point in the history
  • Loading branch information
chiphogg committed Nov 12, 2024
1 parent 183e6c7 commit aa8896c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions au/code/au/utility/test/probable_primes_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,12 @@ TEST(Gcd, HandlesZeroCorrectly) {

TEST(JacobiSymbol, ZeroWhenCommonFactorExists) {
for (int i = -20; i <= 20; ++i) {
for (int j = 1; j <= 19; j += 2) {
for (int factor = 3; factor < 200; factor += 2) {
for (auto j = 1u; j <= 19u; j += 2u) {
for (auto factor = 3u; factor < 200u; factor += 2u) {
// Make sure that `j * factor` is odd, or else the result is undefined.
EXPECT_EQ(jacobi_symbol(i * factor, j * factor), 0)
<< "jacobi(" << i * factor << ", " << j * factor << ") should be 0";
EXPECT_EQ(jacobi_symbol(i * static_cast<int>(factor), j * factor), 0)
<< "jacobi(" << i * static_cast<int>(factor) << ", " << j * factor
<< ") should be 0";
}
}
}
Expand Down

0 comments on commit aa8896c

Please sign in to comment.