1 error: exponent for bases 2 and e can be computed more accurately
2 --> $DIR/floating_point_powf.rs:7:13
4 LL | let _ = 2f32.powf(x);
5 | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
7 = note: `-D clippy::suboptimal-flops` implied by `-D warnings`
9 error: exponent for bases 2 and e can be computed more accurately
10 --> $DIR/floating_point_powf.rs:8: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:9: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:10: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:11: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:12: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:13: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:14:13
48 LL | let _ = x.powf(1.0 / 3.0);
49 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
51 = note: `-D clippy::imprecise-flops` implied by `-D warnings`
53 error: cube-root of a number can be computed more accurately
54 --> $DIR/floating_point_powf.rs:15:13
56 LL | let _ = (x as f32).powf(1.0 / 3.0);
57 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).cbrt()`
59 error: exponentiation with integer powers can be computed more efficiently
60 --> $DIR/floating_point_powf.rs:16:13
62 LL | let _ = x.powf(3.0);
63 | ^^^^^^^^^^^ help: consider using: `x.powi(3)`
65 error: exponentiation with integer powers can be computed more efficiently
66 --> $DIR/floating_point_powf.rs:17:13
68 LL | let _ = x.powf(-2.0);
69 | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
71 error: exponentiation with integer powers can be computed more efficiently
72 --> $DIR/floating_point_powf.rs:18:13
74 LL | let _ = x.powf(16_777_215.0);
75 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(16_777_215)`
77 error: exponentiation with integer powers can be computed more efficiently
78 --> $DIR/floating_point_powf.rs:19:13
80 LL | let _ = x.powf(-16_777_215.0);
81 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-16_777_215)`
83 error: exponentiation with integer powers can be computed more efficiently
84 --> $DIR/floating_point_powf.rs:20:13
86 LL | let _ = (x as f32).powf(-16_777_215.0);
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).powi(-16_777_215)`
89 error: exponentiation with integer powers can be computed more efficiently
90 --> $DIR/floating_point_powf.rs:21:13
92 LL | let _ = (x as f32).powf(3.0);
93 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).powi(3)`
95 error: cube-root of a number can be computed more accurately
96 --> $DIR/floating_point_powf.rs:22:13
98 LL | let _ = (1.5_f32 + 1.0).powf(1.0 / 3.0);
99 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(1.5_f32 + 1.0).cbrt()`
101 error: cube-root of a number can be computed more accurately
102 --> $DIR/floating_point_powf.rs:23:13
104 LL | let _ = 1.5_f64.powf(1.0 / 3.0);
105 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.cbrt()`
107 error: square-root of a number can be computed more efficiently and accurately
108 --> $DIR/floating_point_powf.rs:24:13
110 LL | let _ = 1.5_f64.powf(1.0 / 2.0);
111 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.sqrt()`
113 error: exponentiation with integer powers can be computed more efficiently
114 --> $DIR/floating_point_powf.rs:25:13
116 LL | let _ = 1.5_f64.powf(3.0);
117 | ^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.powi(3)`
119 error: exponent for bases 2 and e can be computed more accurately
120 --> $DIR/floating_point_powf.rs:34:13
122 LL | let _ = 2f64.powf(x);
123 | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
125 error: exponent for bases 2 and e can be computed more accurately
126 --> $DIR/floating_point_powf.rs:35:13
128 LL | let _ = 2f64.powf(3.1);
129 | ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`
131 error: exponent for bases 2 and e can be computed more accurately
132 --> $DIR/floating_point_powf.rs:36:13
134 LL | let _ = 2f64.powf(-3.1);
135 | ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`
137 error: exponent for bases 2 and e can be computed more accurately
138 --> $DIR/floating_point_powf.rs:37:13
140 LL | let _ = std::f64::consts::E.powf(x);
141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
143 error: exponent for bases 2 and e can be computed more accurately
144 --> $DIR/floating_point_powf.rs:38:13
146 LL | let _ = std::f64::consts::E.powf(3.1);
147 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`
149 error: exponent for bases 2 and e can be computed more accurately
150 --> $DIR/floating_point_powf.rs:39:13
152 LL | let _ = std::f64::consts::E.powf(-3.1);
153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`
155 error: square-root of a number can be computed more efficiently and accurately
156 --> $DIR/floating_point_powf.rs:40:13
158 LL | let _ = x.powf(1.0 / 2.0);
159 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
161 error: cube-root of a number can be computed more accurately
162 --> $DIR/floating_point_powf.rs:41:13
164 LL | let _ = x.powf(1.0 / 3.0);
165 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
167 error: exponentiation with integer powers can be computed more efficiently
168 --> $DIR/floating_point_powf.rs:42:13
170 LL | let _ = x.powf(3.0);
171 | ^^^^^^^^^^^ help: consider using: `x.powi(3)`
173 error: exponentiation with integer powers can be computed more efficiently
174 --> $DIR/floating_point_powf.rs:43:13
176 LL | let _ = x.powf(-2.0);
177 | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
179 error: exponentiation with integer powers can be computed more efficiently
180 --> $DIR/floating_point_powf.rs:44:13
182 LL | let _ = x.powf(-2_147_483_648.0);
183 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-2_147_483_648)`
185 error: exponentiation with integer powers can be computed more efficiently
186 --> $DIR/floating_point_powf.rs:45:13
188 LL | let _ = x.powf(2_147_483_647.0);
189 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2_147_483_647)`
191 error: aborting due to 31 previous errors