@@ -92,77 +92,101 @@ error: exponentiation with integer powers can be computed more efficiently
9292LL | let _ = (x as f32).powf(3.0);
9393 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).powi(3)`
9494
95+ error: cube-root of a number can be computed more accurately
96+ --> $DIR/floating_point_powf.rs:21:13
97+ |
98+ LL | let _ = (1.5_f32 + 1.0).powf(1.0 / 3.0);
99+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(1.5_f32 + 1.0).cbrt()`
100+
101+ error: cube-root of a number can be computed more accurately
102+ --> $DIR/floating_point_powf.rs:22:13
103+ |
104+ LL | let _ = 1.5_f64.powf(1.0 / 3.0);
105+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.cbrt()`
106+
107+ error: square-root of a number can be computed more efficiently and accurately
108+ --> $DIR/floating_point_powf.rs:23:13
109+ |
110+ LL | let _ = 1.5_f64.powf(1.0 / 2.0);
111+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.sqrt()`
112+
113+ error: exponentiation with integer powers can be computed more efficiently
114+ --> $DIR/floating_point_powf.rs:24:13
115+ |
116+ LL | let _ = 1.5_f64.powf(3.0);
117+ | ^^^^^^^^^^^^^^^^^ help: consider using: `1.5_f64.powi(3)`
118+
95119error: exponent for bases 2 and e can be computed more accurately
96- --> $DIR/floating_point_powf.rs:28 :13
120+ --> $DIR/floating_point_powf.rs:33 :13
97121 |
98122LL | let _ = 2f64.powf(x);
99123 | ^^^^^^^^^^^^ help: consider using: `x.exp2()`
100124
101125error: exponent for bases 2 and e can be computed more accurately
102- --> $DIR/floating_point_powf.rs:29 :13
126+ --> $DIR/floating_point_powf.rs:34 :13
103127 |
104128LL | let _ = 2f64.powf(3.1);
105129 | ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`
106130
107131error: exponent for bases 2 and e can be computed more accurately
108- --> $DIR/floating_point_powf.rs:30 :13
132+ --> $DIR/floating_point_powf.rs:35 :13
109133 |
110134LL | let _ = 2f64.powf(-3.1);
111135 | ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`
112136
113137error: exponent for bases 2 and e can be computed more accurately
114- --> $DIR/floating_point_powf.rs:31 :13
138+ --> $DIR/floating_point_powf.rs:36 :13
115139 |
116140LL | let _ = std::f64::consts::E.powf(x);
117141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
118142
119143error: exponent for bases 2 and e can be computed more accurately
120- --> $DIR/floating_point_powf.rs:32 :13
144+ --> $DIR/floating_point_powf.rs:37 :13
121145 |
122146LL | let _ = std::f64::consts::E.powf(3.1);
123147 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`
124148
125149error: exponent for bases 2 and e can be computed more accurately
126- --> $DIR/floating_point_powf.rs:33 :13
150+ --> $DIR/floating_point_powf.rs:38 :13
127151 |
128152LL | let _ = std::f64::consts::E.powf(-3.1);
129153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`
130154
131155error: square-root of a number can be computed more efficiently and accurately
132- --> $DIR/floating_point_powf.rs:34 :13
156+ --> $DIR/floating_point_powf.rs:39 :13
133157 |
134158LL | let _ = x.powf(1.0 / 2.0);
135159 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
136160
137161error: cube-root of a number can be computed more accurately
138- --> $DIR/floating_point_powf.rs:35 :13
162+ --> $DIR/floating_point_powf.rs:40 :13
139163 |
140164LL | let _ = x.powf(1.0 / 3.0);
141165 | ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
142166
143167error: exponentiation with integer powers can be computed more efficiently
144- --> $DIR/floating_point_powf.rs:36 :13
168+ --> $DIR/floating_point_powf.rs:41 :13
145169 |
146170LL | let _ = x.powf(3.0);
147171 | ^^^^^^^^^^^ help: consider using: `x.powi(3)`
148172
149173error: exponentiation with integer powers can be computed more efficiently
150- --> $DIR/floating_point_powf.rs:37 :13
174+ --> $DIR/floating_point_powf.rs:42 :13
151175 |
152176LL | let _ = x.powf(-2.0);
153177 | ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
154178
155179error: exponentiation with integer powers can be computed more efficiently
156- --> $DIR/floating_point_powf.rs:38 :13
180+ --> $DIR/floating_point_powf.rs:43 :13
157181 |
158182LL | let _ = x.powf(-2_147_483_648.0);
159183 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-2_147_483_648)`
160184
161185error: exponentiation with integer powers can be computed more efficiently
162- --> $DIR/floating_point_powf.rs:39 :13
186+ --> $DIR/floating_point_powf.rs:44 :13
163187 |
164188LL | let _ = x.powf(2_147_483_647.0);
165189 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2_147_483_647)`
166190
167- error: aborting due to 27 previous errors
191+ error: aborting due to 31 previous errors
168192
0 commit comments