fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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