2020-07-14 12:59:59 +00:00
|
|
|
#![warn(clippy::suboptimal_flops)]
|
2022-10-06 07:44:38 +00:00
|
|
|
#![allow(clippy::unnecessary_cast)]
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 3f32;
|
|
|
|
let y = 5f32;
|
|
|
|
let _ = x.ln() / y.ln();
|
2022-08-31 13:24:45 +00:00
|
|
|
let _ = (x as f32).ln() / y.ln();
|
2020-07-14 12:59:59 +00:00
|
|
|
let _ = x.log2() / y.log2();
|
|
|
|
let _ = x.log10() / y.log10();
|
|
|
|
let _ = x.log(5f32) / y.log(5f32);
|
|
|
|
// 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);
|
|
|
|
}
|