2023-04-20 14:37:15 +00:00
|
|
|
//@run-rustfix
|
2020-06-01 21:32:52 +00:00
|
|
|
#![warn(clippy::suboptimal_flops)]
|
2022-10-02 09:53:58 +00:00
|
|
|
#![allow(clippy::unnecessary_cast)]
|
2020-06-01 21:32:52 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 3f32;
|
|
|
|
let y = 5f32;
|
|
|
|
let _ = x.log(y);
|
2022-08-29 20:36:11 +00:00
|
|
|
let _ = (x as f32).log(y);
|
2020-06-01 21:32:52 +00:00
|
|
|
let _ = x.log(y);
|
|
|
|
let _ = x.log(y);
|
|
|
|
let _ = x.log(y);
|
|
|
|
// Cases where the lint shouldn't be applied
|
|
|
|
let _ = x.ln() / y.powf(3.2);
|
|
|
|
let _ = x.powf(3.2) / y.powf(3.2);
|
|
|
|
let _ = x.powf(3.2) / y.ln();
|
|
|
|
let _ = x.log(5f32) / y.log(7f32);
|
|
|
|
}
|