Skip to content

Commit

Permalink
smol refactor to fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rbledsaw3 committed Nov 5, 2023
1 parent 1990489 commit 63a4460
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void test_roll() {
// Test 1: Check bounds
for (int i = 0; i < 10000; ++i) {
int result = roll<3, 6>();
if (result < 3 || result > 18) {
if ((result < 3) || (result > 18)) {
std::cout << "Test 1 Failed: Value out of range. Result: "
<< result << std::endl;
return;
Expand All @@ -22,7 +22,7 @@ void test_roll() {
total += roll<1, 6>();
}
double average = static_cast<double>(total) / rolls;
if (average < 3.4 || average > 3.6) {
if ((average < 3.4) || (average > 3.6)) {
std::cout <<
"Test 2 Failed: Distribution does not appear to be uniform. Mean: "
<< average << std::endl;
Expand Down

0 comments on commit 63a4460

Please sign in to comment.