]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/floating_point_logbase.fixed
New upstream version 1.65.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / floating_point_logbase.fixed
1 // run-rustfix
2 #![warn(clippy::suboptimal_flops)]
3
4 fn main() {
5 let x = 3f32;
6 let y = 5f32;
7 let _ = x.log(y);
8 let _ = (x as f32).log(y);
9 let _ = x.log(y);
10 let _ = x.log(y);
11 let _ = x.log(y);
12 // Cases where the lint shouldn't be applied
13 let _ = x.ln() / y.powf(3.2);
14 let _ = x.powf(3.2) / y.powf(3.2);
15 let _ = x.powf(3.2) / y.ln();
16 let _ = x.log(5f32) / y.log(7f32);
17 }