1 error: exponent for bases 2 and e can be computed more accurately
2 --> $DIR/floating_point_powf.rs:5:13
4 LL | let _ = 2f32.powf(x);
5 | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
7 = note: `-D clippy::floating-point-improvements` implied by `-D warnings`
9 error: exponent for bases 2 and e can be computed more accurately
10 --> $DIR/floating_point_powf.rs:6:13
12 LL | let _ = 2f32.powf(3.1);
13 | ^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp2()`
15 error: exponent for bases 2 and e can be computed more accurately
16 --> $DIR/floating_point_powf.rs:7:13
18 LL | let _ = 2f32.powf(-3.1);
19 | ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp2()`
21 error: exponent for bases 2 and e can be computed more accurately
22 --> $DIR/floating_point_powf.rs:8:13
24 LL | let _ = std::f32::consts::E.powf(x);
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
27 error: exponent for bases 2 and e can be computed more accurately
28 --> $DIR/floating_point_powf.rs:9:13
30 LL | let _ = std::f32::consts::E.powf(3.1);
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp()`
33 error: exponent for bases 2 and e can be computed more accurately
34 --> $DIR/floating_point_powf.rs:10:13
36 LL | let _ = std::f32::consts::E.powf(-3.1);
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp()`
39 error: square-root of a number can be computed more efficiently and accurately
40 --> $DIR/floating_point_powf.rs:11:13
42 LL | let _ = x.powf(1.0 / 2.0);
43 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
45 error: cube-root of a number can be computed more accurately
46 --> $DIR/floating_point_powf.rs:12:13
48 LL | let _ = x.powf(1.0 / 3.0);
49 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
51 error: exponentiation with integer powers can be computed more efficiently
52 --> $DIR/floating_point_powf.rs:13:13
54 LL | let _ = x.powf(2.0);
55 | ^^^^^^^^^^^ help: consider using: `x.powi(2)`
57 error: exponentiation with integer powers can be computed more efficiently
58 --> $DIR/floating_point_powf.rs:14:13
60 LL | let _ = x.powf(-2.0);
61 | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
63 error: exponent for bases 2 and e can be computed more accurately
64 --> $DIR/floating_point_powf.rs:21:13
66 LL | let _ = 2f64.powf(x);
67 | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
69 error: exponent for bases 2 and e can be computed more accurately
70 --> $DIR/floating_point_powf.rs:22:13
72 LL | let _ = 2f64.powf(3.1);
73 | ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`
75 error: exponent for bases 2 and e can be computed more accurately
76 --> $DIR/floating_point_powf.rs:23:13
78 LL | let _ = 2f64.powf(-3.1);
79 | ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`
81 error: exponent for bases 2 and e can be computed more accurately
82 --> $DIR/floating_point_powf.rs:24:13
84 LL | let _ = std::f64::consts::E.powf(x);
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
87 error: exponent for bases 2 and e can be computed more accurately
88 --> $DIR/floating_point_powf.rs:25:13
90 LL | let _ = std::f64::consts::E.powf(3.1);
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`
93 error: exponent for bases 2 and e can be computed more accurately
94 --> $DIR/floating_point_powf.rs:26:13
96 LL | let _ = std::f64::consts::E.powf(-3.1);
97 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`
99 error: square-root of a number can be computed more efficiently and accurately
100 --> $DIR/floating_point_powf.rs:27:13
102 LL | let _ = x.powf(1.0 / 2.0);
103 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
105 error: cube-root of a number can be computed more accurately
106 --> $DIR/floating_point_powf.rs:28:13
108 LL | let _ = x.powf(1.0 / 3.0);
109 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
111 error: exponentiation with integer powers can be computed more efficiently
112 --> $DIR/floating_point_powf.rs:29:13
114 LL | let _ = x.powf(2.0);
115 | ^^^^^^^^^^^ help: consider using: `x.powi(2)`
117 error: exponentiation with integer powers can be computed more efficiently
118 --> $DIR/floating_point_powf.rs:30:13
120 LL | let _ = x.powf(-2.0);
121 | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
123 error: aborting due to 20 previous errors