@@ -120,53 +120,77 @@ error: cube-root of a number can be computed more accurately
120
120
LL | let _ = x.powf(1.0 / 3.0);
121
121
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
122
122
123
+ error: exponentiation with integer powers can be computed more efficiently
124
+ --> $DIR/floating_point_arithmetic.rs:49:13
125
+ |
126
+ LL | let _ = x.powf(2.0);
127
+ | ^^^^^^^^^^^ help: consider using: `x.powi(2)`
128
+
129
+ error: exponentiation with integer powers can be computed more efficiently
130
+ --> $DIR/floating_point_arithmetic.rs:50:13
131
+ |
132
+ LL | let _ = x.powf(-2.0);
133
+ | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
134
+
123
135
error: exponent for bases 2 and e can be computed more accurately
124
- --> $DIR/floating_point_arithmetic.rs:51 :13
136
+ --> $DIR/floating_point_arithmetic.rs:57 :13
125
137
|
126
138
LL | let _ = 2f64.powf(x);
127
139
| ^^^^^^^^^^^^ help: consider using: `x.exp2()`
128
140
129
141
error: exponent for bases 2 and e can be computed more accurately
130
- --> $DIR/floating_point_arithmetic.rs:52 :13
142
+ --> $DIR/floating_point_arithmetic.rs:58 :13
131
143
|
132
144
LL | let _ = std::f64::consts::E.powf(x);
133
145
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
134
146
135
147
error: square-root of a number can be computed more efficiently and accurately
136
- --> $DIR/floating_point_arithmetic.rs:53 :13
148
+ --> $DIR/floating_point_arithmetic.rs:59 :13
137
149
|
138
150
LL | let _ = x.powf(1.0 / 2.0);
139
151
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
140
152
141
153
error: cube-root of a number can be computed more accurately
142
- --> $DIR/floating_point_arithmetic.rs:54 :13
154
+ --> $DIR/floating_point_arithmetic.rs:60 :13
143
155
|
144
156
LL | let _ = x.powf(1.0 / 3.0);
145
157
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
146
158
159
+ error: exponentiation with integer powers can be computed more efficiently
160
+ --> $DIR/floating_point_arithmetic.rs:61:13
161
+ |
162
+ LL | let _ = x.powf(2.0);
163
+ | ^^^^^^^^^^^ help: consider using: `x.powi(2)`
164
+
165
+ error: exponentiation with integer powers can be computed more efficiently
166
+ --> $DIR/floating_point_arithmetic.rs:62:13
167
+ |
168
+ LL | let _ = x.powf(-2.0);
169
+ | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
170
+
147
171
error: (e.pow(x) - 1) can be computed more accurately
148
- --> $DIR/floating_point_arithmetic.rs:59 :13
172
+ --> $DIR/floating_point_arithmetic.rs:71 :13
149
173
|
150
174
LL | let _ = x.exp() - 1.0;
151
175
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
152
176
153
177
error: (e.pow(x) - 1) can be computed more accurately
154
- --> $DIR/floating_point_arithmetic.rs:60 :13
178
+ --> $DIR/floating_point_arithmetic.rs:72 :13
155
179
|
156
180
LL | let _ = x.exp() - 1.0 + 2.0;
157
181
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
158
182
159
183
error: (e.pow(x) - 1) can be computed more accurately
160
- --> $DIR/floating_point_arithmetic.rs:66 :13
184
+ --> $DIR/floating_point_arithmetic.rs:78 :13
161
185
|
162
186
LL | let _ = x.exp() - 1.0;
163
187
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
164
188
165
189
error: (e.pow(x) - 1) can be computed more accurately
166
- --> $DIR/floating_point_arithmetic.rs:67 :13
190
+ --> $DIR/floating_point_arithmetic.rs:79 :13
167
191
|
168
192
LL | let _ = x.exp() - 1.0 + 2.0;
169
193
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
170
194
171
- error: aborting due to 28 previous errors
195
+ error: aborting due to 32 previous errors
172
196
0 commit comments