style: include IM_BAD_CHECK_FOR_ODD (#5213)

This commit is contained in:
Piotr Idzik 2024-06-13 06:37:14 +02:00 committed by GitHub
parent 3ecd13508a
commit f8698674b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 4 deletions

View File

@ -65,9 +65,6 @@
<Match>
<Bug pattern="MS_EXPOSE_REP" />
</Match>
<Match>
<Bug pattern="IM_BAD_CHECK_FOR_ODD" />
</Match>
<Match>
<Bug pattern="DM_BOXED_PRIMITIVE_FOR_PARSING" />
</Match>

View File

@ -63,7 +63,7 @@ public class SimpsonIntegration {
if (i == 0 || i == data.size() - 1) {
integralEvaluation += data.get(i);
System.out.println("Multiply f(x" + i + ") by 1");
} else if (i % 2 == 1) {
} else if (i % 2 != 0) {
integralEvaluation += (double) 4 * data.get(i);
System.out.println("Multiply f(x" + i + ") by 4");
} else {