@@ -120,53 +120,77 @@ error: cube-root of a number can be computed more accurately
120120LL | let _ = x.powf(1.0 / 3.0);
121121 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
122122
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+
123135error: 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
125137 |
126138LL | let _ = 2f64.powf(x);
127139 | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
128140
129141error: 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
131143 |
132144LL | let _ = std::f64::consts::E.powf(x);
133145 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
134146
135147error: 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
137149 |
138150LL | let _ = x.powf(1.0 / 2.0);
139151 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
140152
141153error: 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
143155 |
144156LL | let _ = x.powf(1.0 / 3.0);
145157 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
146158
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+
147171error: (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
149173 |
150174LL | let _ = x.exp() - 1.0;
151175 | ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
152176
153177error: (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
155179 |
156180LL | let _ = x.exp() - 1.0 + 2.0;
157181 | ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
158182
159183error: (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
161185 |
162186LL | let _ = x.exp() - 1.0;
163187 | ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
164188
165189error: (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
167191 |
168192LL | let _ = x.exp() - 1.0 + 2.0;
169193 | ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
170194
171- error: aborting due to 28 previous errors
195+ error: aborting due to 32 previous errors
172196
0 commit comments