]> git.lizzy.rs Git - rust.git/blob - tests/ui/floating_point_logbase.fixed
Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obk
[rust.git] / tests / ui / floating_point_logbase.fixed
1 // run-rustfix
2 #![warn(clippy::suboptimal_flops)]
3 #![allow(clippy::unnecessary_cast)]
4
5 fn main() {
6     let x = 3f32;
7     let y = 5f32;
8     let _ = x.log(y);
9     let _ = (x as f32).log(y);
10     let _ = x.log(y);
11     let _ = x.log(y);
12     let _ = x.log(y);
13     // Cases where the lint shouldn't be applied
14     let _ = x.ln() / y.powf(3.2);
15     let _ = x.powf(3.2) / y.powf(3.2);
16     let _ = x.powf(3.2) / y.ln();
17     let _ = x.log(5f32) / y.log(7f32);
18 }