1 #![warn(clippy::modulo_arithmetic)]
2 #![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::modulo_one)]
5 // Lint when both sides are const and of the opposite sign
8 (1.1 - 2.3) % (1.1 + 2.3);
9 (1.1 + 2.3) % (1.1 - 2.3);
11 // Lint on floating point numbers
12 let a_f32: f32 = -1.6;
13 let mut b_f32: f32 = 2.1;
18 let a_f64: f64 = -1.6;
19 let mut b_f64: f64 = 2.1;
24 // No lint when both sides are const and of the same sign
27 (1.1 + 2.3) % (-1.1 + 2.3);
28 (-1.1 - 2.3) % (1.1 - 2.3);