]> git.lizzy.rs Git - rust.git/blob - tests/ui/floating_point_powf.rs
Change lint name to `suboptimal_flops`
[rust.git] / tests / ui / floating_point_powf.rs
1 #![warn(clippy::suboptimal_flops)]
2
3 fn main() {
4     let x = 3f32;
5     let _ = 2f32.powf(x);
6     let _ = 2f32.powf(3.1);
7     let _ = 2f32.powf(-3.1);
8     let _ = std::f32::consts::E.powf(x);
9     let _ = std::f32::consts::E.powf(3.1);
10     let _ = std::f32::consts::E.powf(-3.1);
11     let _ = x.powf(1.0 / 2.0);
12     let _ = x.powf(1.0 / 3.0);
13     let _ = x.powf(2.0);
14     let _ = x.powf(-2.0);
15     let _ = x.powf(2.1);
16     let _ = x.powf(-2.1);
17
18     let x = 3f64;
19     let _ = 2f64.powf(x);
20     let _ = 2f64.powf(3.1);
21     let _ = 2f64.powf(-3.1);
22     let _ = std::f64::consts::E.powf(x);
23     let _ = std::f64::consts::E.powf(3.1);
24     let _ = std::f64::consts::E.powf(-3.1);
25     let _ = x.powf(1.0 / 2.0);
26     let _ = x.powf(1.0 / 3.0);
27     let _ = x.powf(2.0);
28     let _ = x.powf(-2.0);
29     let _ = x.powf(2.1);
30     let _ = x.powf(-2.1);
31 }