@@ -92,77 +92,101 @@ error: exponentiation with integer powers can be computed more efficiently
92
92
LL | let _ = (x as f32).powf(3.0);
93
93
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).powi(3)`
94
94
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
+
95
119
error: 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
97
121
|
98
122
LL | let _ = 2f64.powf(x);
99
123
| ^^^^^^^^^^^^ help: consider using: `x.exp2()`
100
124
101
125
error: 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
103
127
|
104
128
LL | let _ = 2f64.powf(3.1);
105
129
| ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`
106
130
107
131
error: 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
109
133
|
110
134
LL | let _ = 2f64.powf(-3.1);
111
135
| ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`
112
136
113
137
error: 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
115
139
|
116
140
LL | let _ = std::f64::consts::E.powf(x);
117
141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
118
142
119
143
error: 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
121
145
|
122
146
LL | let _ = std::f64::consts::E.powf(3.1);
123
147
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`
124
148
125
149
error: 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
127
151
|
128
152
LL | let _ = std::f64::consts::E.powf(-3.1);
129
153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`
130
154
131
155
error: 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
133
157
|
134
158
LL | let _ = x.powf(1.0 / 2.0);
135
159
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
136
160
137
161
error: 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
139
163
|
140
164
LL | let _ = x.powf(1.0 / 3.0);
141
165
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
142
166
143
167
error: 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
145
169
|
146
170
LL | let _ = x.powf(3.0);
147
171
| ^^^^^^^^^^^ help: consider using: `x.powi(3)`
148
172
149
173
error: 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
151
175
|
152
176
LL | let _ = x.powf(-2.0);
153
177
| ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
154
178
155
179
error: 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
157
181
|
158
182
LL | let _ = x.powf(-2_147_483_648.0);
159
183
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-2_147_483_648)`
160
184
161
185
error: 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
163
187
|
164
188
LL | let _ = x.powf(2_147_483_647.0);
165
189
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2_147_483_647)`
166
190
167
- error: aborting due to 27 previous errors
191
+ error: aborting due to 31 previous errors
168
192
0 commit comments