]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/floating_point_mul_add.fixed
Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / floating_point_mul_add.fixed
1 // run-rustfix
2 #![warn(clippy::suboptimal_flops)]
3
4 fn main() {
5     let a: f64 = 1234.567;
6     let b: f64 = 45.67834;
7     let c: f64 = 0.0004;
8     let d: f64 = 0.0001;
9
10     let _ = a.mul_add(b, c);
11     let _ = a.mul_add(b, c);
12     let _ = 2.0f64.mul_add(4.0, a);
13     let _ = 2.0f64.mul_add(4., a);
14
15     let _ = a.mul_add(b, c);
16     let _ = a.mul_add(b, c);
17     let _ = (a * b).mul_add(c, d);
18
19     let _ = a.mul_add(b, c).mul_add(a.mul_add(b, c), a.mul_add(b, c)) + c;
20     let _ = 1234.567_f64.mul_add(45.67834_f64, 0.0004_f64);
21 }