|
1 | 1 | error: exponent for bases 2 and e can be computed more accurately
|
2 |
| - --> $DIR/floating_point_powf.rs:6:13 |
| 2 | + --> $DIR/floating_point_powf.rs:7:13 |
3 | 3 | |
|
4 | 4 | LL | let _ = 2f32.powf(x);
|
5 | 5 | | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::suboptimal-flops` implied by `-D warnings`
|
8 | 8 |
|
9 | 9 | error: exponent for bases 2 and e can be computed more accurately
|
10 |
| - --> $DIR/floating_point_powf.rs:7:13 |
| 10 | + --> $DIR/floating_point_powf.rs:8:13 |
11 | 11 | |
|
12 | 12 | LL | let _ = 2f32.powf(3.1);
|
13 | 13 | | ^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp2()`
|
14 | 14 |
|
15 | 15 | error: exponent for bases 2 and e can be computed more accurately
|
16 |
| - --> $DIR/floating_point_powf.rs:8:13 |
| 16 | + --> $DIR/floating_point_powf.rs:9:13 |
17 | 17 | |
|
18 | 18 | LL | let _ = 2f32.powf(-3.1);
|
19 | 19 | | ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp2()`
|
20 | 20 |
|
21 | 21 | error: exponent for bases 2 and e can be computed more accurately
|
22 |
| - --> $DIR/floating_point_powf.rs:9:13 |
| 22 | + --> $DIR/floating_point_powf.rs:10:13 |
23 | 23 | |
|
24 | 24 | LL | let _ = std::f32::consts::E.powf(x);
|
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
|
26 | 26 |
|
27 | 27 | error: exponent for bases 2 and e can be computed more accurately
|
28 |
| - --> $DIR/floating_point_powf.rs:10:13 |
| 28 | + --> $DIR/floating_point_powf.rs:11:13 |
29 | 29 | |
|
30 | 30 | LL | let _ = std::f32::consts::E.powf(3.1);
|
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp()`
|
32 | 32 |
|
33 | 33 | error: exponent for bases 2 and e can be computed more accurately
|
34 |
| - --> $DIR/floating_point_powf.rs:11:13 |
| 34 | + --> $DIR/floating_point_powf.rs:12:13 |
35 | 35 | |
|
36 | 36 | LL | let _ = std::f32::consts::E.powf(-3.1);
|
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp()`
|
38 | 38 |
|
39 | 39 | error: square-root of a number can be computed more efficiently and accurately
|
40 |
| - --> $DIR/floating_point_powf.rs:12:13 |
| 40 | + --> $DIR/floating_point_powf.rs:13:13 |
41 | 41 | |
|
42 | 42 | LL | let _ = x.powf(1.0 / 2.0);
|
43 | 43 | | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
|
44 | 44 |
|
45 | 45 | error: cube-root of a number can be computed more accurately
|
46 |
| - --> $DIR/floating_point_powf.rs:13:13 |
| 46 | + --> $DIR/floating_point_powf.rs:14:13 |
47 | 47 | |
|
48 | 48 | LL | let _ = x.powf(1.0 / 3.0);
|
49 | 49 | | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
|
50 | 50 | |
|
51 | 51 | = note: `-D clippy::imprecise-flops` implied by `-D warnings`
|
52 | 52 |
|
53 | 53 | error: cube-root of a number can be computed more accurately
|
54 |
| - --> $DIR/floating_point_powf.rs:14:13 |
| 54 | + --> $DIR/floating_point_powf.rs:15:13 |
55 | 55 | |
|
56 | 56 | LL | let _ = (x as f32).powf(1.0 / 3.0);
|
57 | 57 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).cbrt()`
|
58 | 58 |
|
59 | 59 | error: exponentiation with integer powers can be computed more efficiently
|
60 |
| - --> $DIR/floating_point_powf.rs:15:13 |
| 60 | + --> $DIR/floating_point_powf.rs:16:13 |
61 | 61 | |
|
62 | 62 | LL | let _ = x.powf(3.0);
|
63 | 63 | | ^^^^^^^^^^^ help: consider using: `x.powi(3)`
|
64 | 64 |
|
65 | 65 | error: exponentiation with integer powers can be computed more efficiently
|
66 |
| - --> $DIR/floating_point_powf.rs:16:13 |
| 66 | + --> $DIR/floating_point_powf.rs:17:13 |
67 | 67 | |
|
68 | 68 | LL | let _ = x.powf(-2.0);
|
69 | 69 | | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
|
70 | 70 |
|
71 | 71 | error: exponentiation with integer powers can be computed more efficiently
|
72 |
| - --> $DIR/floating_point_powf.rs:17:13 |
| 72 | + --> $DIR/floating_point_powf.rs:18:13 |
73 | 73 | |
|
74 | 74 | LL | let _ = x.powf(16_777_215.0);
|
75 | 75 | | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(16_777_215)`
|
76 | 76 |
|
77 | 77 | error: exponentiation with integer powers can be computed more efficiently
|
78 |
| - --> $DIR/floating_point_powf.rs:18:13 |
| 78 | + --> $DIR/floating_point_powf.rs:19:13 |
79 | 79 | |
|
80 | 80 | LL | let _ = x.powf(-16_777_215.0);
|
81 | 81 | | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-16_777_215)`
|
82 | 82 |
|
83 | 83 | error: exponentiation with integer powers can be computed more efficiently
|
84 |
| - --> $DIR/floating_point_powf.rs:19:13 |
| 84 | + --> $DIR/floating_point_powf.rs:20:13 |
85 | 85 | |
|
86 | 86 | LL | let _ = (x as f32).powf(-16_777_215.0);
|
87 | 87 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).powi(-16_777_215)`
|
88 | 88 |
|
89 | 89 | error: exponentiation with integer powers can be computed more efficiently
|
90 |
| - --> $DIR/floating_point_powf.rs:20:13 |
| 90 | + --> $DIR/floating_point_powf.rs:21:13 |
91 | 91 | |
|
92 | 92 | LL | let _ = (x as f32).powf(3.0);
|
93 | 93 | | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).powi(3)`
|
94 | 94 |
|
95 | 95 | error: cube-root of a number can be computed more accurately
|
96 |
| - --> $DIR/floating_point_powf.rs:21:13 |
| 96 | + --> $DIR/floating_point_powf.rs:22:13 |
97 | 97 | |
|
98 | 98 | LL | let _ = (1.5_f32 + 1.0).powf(1.0 / 3.0);
|
99 | 99 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(1.5_f32 + 1.0).cbrt()`
|
100 | 100 |
|
101 | 101 | error: cube-root of a number can be computed more accurately
|
102 |
| - --> $DIR/floating_point_powf.rs:22:13 |
| 102 | + --> $DIR/floating_point_powf.rs:23:13 |
103 | 103 | |
|
104 | 104 | LL | let _ = 1.5_f64.powf(1.0 / 3.0);
|
105 | 105 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.cbrt()`
|
106 | 106 |
|
107 | 107 | error: square-root of a number can be computed more efficiently and accurately
|
108 |
| - --> $DIR/floating_point_powf.rs:23:13 |
| 108 | + --> $DIR/floating_point_powf.rs:24:13 |
109 | 109 | |
|
110 | 110 | LL | let _ = 1.5_f64.powf(1.0 / 2.0);
|
111 | 111 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.sqrt()`
|
112 | 112 |
|
113 | 113 | error: exponentiation with integer powers can be computed more efficiently
|
114 |
| - --> $DIR/floating_point_powf.rs:24:13 |
| 114 | + --> $DIR/floating_point_powf.rs:25:13 |
115 | 115 | |
|
116 | 116 | LL | let _ = 1.5_f64.powf(3.0);
|
117 | 117 | | ^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.powi(3)`
|
118 | 118 |
|
119 | 119 | error: exponent for bases 2 and e can be computed more accurately
|
120 |
| - --> $DIR/floating_point_powf.rs:33:13 |
| 120 | + --> $DIR/floating_point_powf.rs:34:13 |
121 | 121 | |
|
122 | 122 | LL | let _ = 2f64.powf(x);
|
123 | 123 | | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
|
124 | 124 |
|
125 | 125 | error: exponent for bases 2 and e can be computed more accurately
|
126 |
| - --> $DIR/floating_point_powf.rs:34:13 |
| 126 | + --> $DIR/floating_point_powf.rs:35:13 |
127 | 127 | |
|
128 | 128 | LL | let _ = 2f64.powf(3.1);
|
129 | 129 | | ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`
|
130 | 130 |
|
131 | 131 | error: exponent for bases 2 and e can be computed more accurately
|
132 |
| - --> $DIR/floating_point_powf.rs:35:13 |
| 132 | + --> $DIR/floating_point_powf.rs:36:13 |
133 | 133 | |
|
134 | 134 | LL | let _ = 2f64.powf(-3.1);
|
135 | 135 | | ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`
|
136 | 136 |
|
137 | 137 | error: exponent for bases 2 and e can be computed more accurately
|
138 |
| - --> $DIR/floating_point_powf.rs:36:13 |
| 138 | + --> $DIR/floating_point_powf.rs:37:13 |
139 | 139 | |
|
140 | 140 | LL | let _ = std::f64::consts::E.powf(x);
|
141 | 141 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
|
142 | 142 |
|
143 | 143 | error: exponent for bases 2 and e can be computed more accurately
|
144 |
| - --> $DIR/floating_point_powf.rs:37:13 |
| 144 | + --> $DIR/floating_point_powf.rs:38:13 |
145 | 145 | |
|
146 | 146 | LL | let _ = std::f64::consts::E.powf(3.1);
|
147 | 147 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`
|
148 | 148 |
|
149 | 149 | error: exponent for bases 2 and e can be computed more accurately
|
150 |
| - --> $DIR/floating_point_powf.rs:38:13 |
| 150 | + --> $DIR/floating_point_powf.rs:39:13 |
151 | 151 | |
|
152 | 152 | LL | let _ = std::f64::consts::E.powf(-3.1);
|
153 | 153 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`
|
154 | 154 |
|
155 | 155 | error: square-root of a number can be computed more efficiently and accurately
|
156 |
| - --> $DIR/floating_point_powf.rs:39:13 |
| 156 | + --> $DIR/floating_point_powf.rs:40:13 |
157 | 157 | |
|
158 | 158 | LL | let _ = x.powf(1.0 / 2.0);
|
159 | 159 | | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
|
160 | 160 |
|
161 | 161 | error: cube-root of a number can be computed more accurately
|
162 |
| - --> $DIR/floating_point_powf.rs:40:13 |
| 162 | + --> $DIR/floating_point_powf.rs:41:13 |
163 | 163 | |
|
164 | 164 | LL | let _ = x.powf(1.0 / 3.0);
|
165 | 165 | | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
|
166 | 166 |
|
167 | 167 | error: exponentiation with integer powers can be computed more efficiently
|
168 |
| - --> $DIR/floating_point_powf.rs:41:13 |
| 168 | + --> $DIR/floating_point_powf.rs:42:13 |
169 | 169 | |
|
170 | 170 | LL | let _ = x.powf(3.0);
|
171 | 171 | | ^^^^^^^^^^^ help: consider using: `x.powi(3)`
|
172 | 172 |
|
173 | 173 | error: exponentiation with integer powers can be computed more efficiently
|
174 |
| - --> $DIR/floating_point_powf.rs:42:13 |
| 174 | + --> $DIR/floating_point_powf.rs:43:13 |
175 | 175 | |
|
176 | 176 | LL | let _ = x.powf(-2.0);
|
177 | 177 | | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
|
178 | 178 |
|
179 | 179 | error: exponentiation with integer powers can be computed more efficiently
|
180 |
| - --> $DIR/floating_point_powf.rs:43:13 |
| 180 | + --> $DIR/floating_point_powf.rs:44:13 |
181 | 181 | |
|
182 | 182 | LL | let _ = x.powf(-2_147_483_648.0);
|
183 | 183 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-2_147_483_648)`
|
184 | 184 |
|
185 | 185 | error: exponentiation with integer powers can be computed more efficiently
|
186 |
| - --> $DIR/floating_point_powf.rs:44:13 |
| 186 | + --> $DIR/floating_point_powf.rs:45:13 |
187 | 187 | |
|
188 | 188 | LL | let _ = x.powf(2_147_483_647.0);
|
189 | 189 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2_147_483_647)`
|
|
0 commit comments