summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/floating_point_powf.stderr
blob: 2422eb911e90a7041dedbecccf2fa2677a12710d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:6:13
   |
LL |     let _ = 2f32.powf(x);
   |             ^^^^^^^^^^^^ help: consider using: `x.exp2()`
   |
   = note: `-D clippy::suboptimal-flops` implied by `-D warnings`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:7:13
   |
LL |     let _ = 2f32.powf(3.1);
   |             ^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp2()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:8:13
   |
LL |     let _ = 2f32.powf(-3.1);
   |             ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp2()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:9:13
   |
LL |     let _ = std::f32::consts::E.powf(x);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:10:13
   |
LL |     let _ = std::f32::consts::E.powf(3.1);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:11:13
   |
LL |     let _ = std::f32::consts::E.powf(-3.1);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp()`

error: square-root of a number can be computed more efficiently and accurately
  --> $DIR/floating_point_powf.rs:12:13
   |
LL |     let _ = x.powf(1.0 / 2.0);
   |             ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`

error: cube-root of a number can be computed more accurately
  --> $DIR/floating_point_powf.rs:13:13
   |
LL |     let _ = x.powf(1.0 / 3.0);
   |             ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
   |
   = note: `-D clippy::imprecise-flops` implied by `-D warnings`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:14:13
   |
LL |     let _ = x.powf(3.0);
   |             ^^^^^^^^^^^ help: consider using: `x.powi(3)`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:15:13
   |
LL |     let _ = x.powf(-2.0);
   |             ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:16:13
   |
LL |     let _ = x.powf(16_777_215.0);
   |             ^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(16_777_215)`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:17:13
   |
LL |     let _ = x.powf(-16_777_215.0);
   |             ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-16_777_215)`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:25:13
   |
LL |     let _ = 2f64.powf(x);
   |             ^^^^^^^^^^^^ help: consider using: `x.exp2()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:26:13
   |
LL |     let _ = 2f64.powf(3.1);
   |             ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:27:13
   |
LL |     let _ = 2f64.powf(-3.1);
   |             ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:28:13
   |
LL |     let _ = std::f64::consts::E.powf(x);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:29:13
   |
LL |     let _ = std::f64::consts::E.powf(3.1);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`

error: exponent for bases 2 and e can be computed more accurately
  --> $DIR/floating_point_powf.rs:30:13
   |
LL |     let _ = std::f64::consts::E.powf(-3.1);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`

error: square-root of a number can be computed more efficiently and accurately
  --> $DIR/floating_point_powf.rs:31:13
   |
LL |     let _ = x.powf(1.0 / 2.0);
   |             ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`

error: cube-root of a number can be computed more accurately
  --> $DIR/floating_point_powf.rs:32:13
   |
LL |     let _ = x.powf(1.0 / 3.0);
   |             ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:33:13
   |
LL |     let _ = x.powf(3.0);
   |             ^^^^^^^^^^^ help: consider using: `x.powi(3)`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:34:13
   |
LL |     let _ = x.powf(-2.0);
   |             ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:35:13
   |
LL |     let _ = x.powf(-2_147_483_648.0);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-2_147_483_648)`

error: exponentiation with integer powers can be computed more efficiently
  --> $DIR/floating_point_powf.rs:36:13
   |
LL |     let _ = x.powf(2_147_483_647.0);
   |             ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2_147_483_647)`

error: aborting due to 24 previous errors