@@ -31,144 +31,150 @@ LL | let _ = x.log(E);
31
31
| ^^^^^^^^ help: consider using: `x.ln()`
32
32
33
33
error: logarithm for bases 2, 10 and e can be computed more accurately
34
- --> $DIR/floating_point_log.rs:17:13
34
+ --> $DIR/floating_point_log.rs:15:13
35
+ |
36
+ LL | let _ = (x as f32).log(2f32);
37
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).log2()`
38
+
39
+ error: logarithm for bases 2, 10 and e can be computed more accurately
40
+ --> $DIR/floating_point_log.rs:18:13
35
41
|
36
42
LL | let _ = x.log(2f64);
37
43
| ^^^^^^^^^^^ help: consider using: `x.log2()`
38
44
39
45
error: logarithm for bases 2, 10 and e can be computed more accurately
40
- --> $DIR/floating_point_log.rs:18 :13
46
+ --> $DIR/floating_point_log.rs:19 :13
41
47
|
42
48
LL | let _ = x.log(10f64);
43
49
| ^^^^^^^^^^^^ help: consider using: `x.log10()`
44
50
45
51
error: logarithm for bases 2, 10 and e can be computed more accurately
46
- --> $DIR/floating_point_log.rs:19 :13
52
+ --> $DIR/floating_point_log.rs:20 :13
47
53
|
48
54
LL | let _ = x.log(std::f64::consts::E);
49
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.ln()`
50
56
51
57
error: ln(1 + x) can be computed more accurately
52
- --> $DIR/floating_point_log.rs:24 :13
58
+ --> $DIR/floating_point_log.rs:25 :13
53
59
|
54
60
LL | let _ = (1f32 + 2.).ln();
55
61
| ^^^^^^^^^^^^^^^^ help: consider using: `2.0f32.ln_1p()`
56
62
|
57
63
= note: `-D clippy::imprecise-flops` implied by `-D warnings`
58
64
59
65
error: ln(1 + x) can be computed more accurately
60
- --> $DIR/floating_point_log.rs:25 :13
66
+ --> $DIR/floating_point_log.rs:26 :13
61
67
|
62
68
LL | let _ = (1f32 + 2.0).ln();
63
69
| ^^^^^^^^^^^^^^^^^ help: consider using: `2.0f32.ln_1p()`
64
70
65
71
error: ln(1 + x) can be computed more accurately
66
- --> $DIR/floating_point_log.rs:26 :13
72
+ --> $DIR/floating_point_log.rs:27 :13
67
73
|
68
74
LL | let _ = (1.0 + x).ln();
69
75
| ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
70
76
71
77
error: ln(1 + x) can be computed more accurately
72
- --> $DIR/floating_point_log.rs:27 :13
78
+ --> $DIR/floating_point_log.rs:28 :13
73
79
|
74
80
LL | let _ = (1.0 + x / 2.0).ln();
75
81
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
76
82
77
83
error: ln(1 + x) can be computed more accurately
78
- --> $DIR/floating_point_log.rs:28 :13
84
+ --> $DIR/floating_point_log.rs:29 :13
79
85
|
80
86
LL | let _ = (1.0 + x.powi(3)).ln();
81
87
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
82
88
83
89
error: ln(1 + x) can be computed more accurately
84
- --> $DIR/floating_point_log.rs:29 :13
90
+ --> $DIR/floating_point_log.rs:30 :13
85
91
|
86
92
LL | let _ = (1.0 + x.powi(3) / 2.0).ln();
87
93
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x.powi(3) / 2.0).ln_1p()`
88
94
89
95
error: ln(1 + x) can be computed more accurately
90
- --> $DIR/floating_point_log.rs:30 :13
96
+ --> $DIR/floating_point_log.rs:31 :13
91
97
|
92
98
LL | let _ = (1.0 + (std::f32::consts::E - 1.0)).ln();
93
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(std::f32::consts::E - 1.0).ln_1p()`
94
100
95
101
error: ln(1 + x) can be computed more accurately
96
- --> $DIR/floating_point_log.rs:31 :13
102
+ --> $DIR/floating_point_log.rs:32 :13
97
103
|
98
104
LL | let _ = (x + 1.0).ln();
99
105
| ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
100
106
101
107
error: ln(1 + x) can be computed more accurately
102
- --> $DIR/floating_point_log.rs:32 :13
108
+ --> $DIR/floating_point_log.rs:33 :13
103
109
|
104
110
LL | let _ = (x.powi(3) + 1.0).ln();
105
111
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
106
112
107
113
error: ln(1 + x) can be computed more accurately
108
- --> $DIR/floating_point_log.rs:33 :13
114
+ --> $DIR/floating_point_log.rs:34 :13
109
115
|
110
116
LL | let _ = (x + 2.0 + 1.0).ln();
111
117
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x + 2.0).ln_1p()`
112
118
113
119
error: ln(1 + x) can be computed more accurately
114
- --> $DIR/floating_point_log.rs:34 :13
120
+ --> $DIR/floating_point_log.rs:35 :13
115
121
|
116
122
LL | let _ = (x / 2.0 + 1.0).ln();
117
123
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
118
124
119
125
error: ln(1 + x) can be computed more accurately
120
- --> $DIR/floating_point_log.rs:42 :13
126
+ --> $DIR/floating_point_log.rs:43 :13
121
127
|
122
128
LL | let _ = (1f64 + 2.).ln();
123
129
| ^^^^^^^^^^^^^^^^ help: consider using: `2.0f64.ln_1p()`
124
130
125
131
error: ln(1 + x) can be computed more accurately
126
- --> $DIR/floating_point_log.rs:43 :13
132
+ --> $DIR/floating_point_log.rs:44 :13
127
133
|
128
134
LL | let _ = (1f64 + 2.0).ln();
129
135
| ^^^^^^^^^^^^^^^^^ help: consider using: `2.0f64.ln_1p()`
130
136
131
137
error: ln(1 + x) can be computed more accurately
132
- --> $DIR/floating_point_log.rs:44 :13
138
+ --> $DIR/floating_point_log.rs:45 :13
133
139
|
134
140
LL | let _ = (1.0 + x).ln();
135
141
| ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
136
142
137
143
error: ln(1 + x) can be computed more accurately
138
- --> $DIR/floating_point_log.rs:45 :13
144
+ --> $DIR/floating_point_log.rs:46 :13
139
145
|
140
146
LL | let _ = (1.0 + x / 2.0).ln();
141
147
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
142
148
143
149
error: ln(1 + x) can be computed more accurately
144
- --> $DIR/floating_point_log.rs:46 :13
150
+ --> $DIR/floating_point_log.rs:47 :13
145
151
|
146
152
LL | let _ = (1.0 + x.powi(3)).ln();
147
153
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
148
154
149
155
error: ln(1 + x) can be computed more accurately
150
- --> $DIR/floating_point_log.rs:47 :13
156
+ --> $DIR/floating_point_log.rs:48 :13
151
157
|
152
158
LL | let _ = (x + 1.0).ln();
153
159
| ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
154
160
155
161
error: ln(1 + x) can be computed more accurately
156
- --> $DIR/floating_point_log.rs:48 :13
162
+ --> $DIR/floating_point_log.rs:49 :13
157
163
|
158
164
LL | let _ = (x.powi(3) + 1.0).ln();
159
165
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
160
166
161
167
error: ln(1 + x) can be computed more accurately
162
- --> $DIR/floating_point_log.rs:49 :13
168
+ --> $DIR/floating_point_log.rs:50 :13
163
169
|
164
170
LL | let _ = (x + 2.0 + 1.0).ln();
165
171
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x + 2.0).ln_1p()`
166
172
167
173
error: ln(1 + x) can be computed more accurately
168
- --> $DIR/floating_point_log.rs:50 :13
174
+ --> $DIR/floating_point_log.rs:51 :13
169
175
|
170
176
LL | let _ = (x / 2.0 + 1.0).ln();
171
177
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
172
178
173
- error: aborting due to 28 previous errors
179
+ error: aborting due to 29 previous errors
174
180
0 commit comments