1 error: logarithm for bases 2, 10 and e can be computed more accurately
2 --> $DIR/floating_point_log.rs:10:13
4 LL | let _ = x.log(2f32);
5 | ^^^^^^^^^^^ help: consider using: `x.log2()`
7 = note: `-D clippy::suboptimal-flops` implied by `-D warnings`
9 error: logarithm for bases 2, 10 and e can be computed more accurately
10 --> $DIR/floating_point_log.rs:11:13
12 LL | let _ = x.log(10f32);
13 | ^^^^^^^^^^^^ help: consider using: `x.log10()`
15 error: logarithm for bases 2, 10 and e can be computed more accurately
16 --> $DIR/floating_point_log.rs:12:13
18 LL | let _ = x.log(std::f32::consts::E);
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.ln()`
21 error: logarithm for bases 2, 10 and e can be computed more accurately
22 --> $DIR/floating_point_log.rs:13:13
24 LL | let _ = x.log(TWO);
25 | ^^^^^^^^^^ help: consider using: `x.log2()`
27 error: logarithm for bases 2, 10 and e can be computed more accurately
28 --> $DIR/floating_point_log.rs:14:13
30 LL | let _ = x.log(E);
31 | ^^^^^^^^ help: consider using: `x.ln()`
33 error: logarithm for bases 2, 10 and e can be computed more accurately
34 --> $DIR/floating_point_log.rs:15:13
36 LL | let _ = (x as f32).log(2f32);
37 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).log2()`
39 error: logarithm for bases 2, 10 and e can be computed more accurately
40 --> $DIR/floating_point_log.rs:18:13
42 LL | let _ = x.log(2f64);
43 | ^^^^^^^^^^^ help: consider using: `x.log2()`
45 error: logarithm for bases 2, 10 and e can be computed more accurately
46 --> $DIR/floating_point_log.rs:19:13
48 LL | let _ = x.log(10f64);
49 | ^^^^^^^^^^^^ help: consider using: `x.log10()`
51 error: logarithm for bases 2, 10 and e can be computed more accurately
52 --> $DIR/floating_point_log.rs:20:13
54 LL | let _ = x.log(std::f64::consts::E);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.ln()`
57 error: ln(1 + x) can be computed more accurately
58 --> $DIR/floating_point_log.rs:25:13
60 LL | let _ = (1f32 + 2.).ln();
61 | ^^^^^^^^^^^^^^^^ help: consider using: `2.0f32.ln_1p()`
63 = note: `-D clippy::imprecise-flops` implied by `-D warnings`
65 error: ln(1 + x) can be computed more accurately
66 --> $DIR/floating_point_log.rs:26:13
68 LL | let _ = (1f32 + 2.0).ln();
69 | ^^^^^^^^^^^^^^^^^ help: consider using: `2.0f32.ln_1p()`
71 error: ln(1 + x) can be computed more accurately
72 --> $DIR/floating_point_log.rs:27:13
74 LL | let _ = (1.0 + x).ln();
75 | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
77 error: ln(1 + x) can be computed more accurately
78 --> $DIR/floating_point_log.rs:28:13
80 LL | let _ = (1.0 + x / 2.0).ln();
81 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
83 error: ln(1 + x) can be computed more accurately
84 --> $DIR/floating_point_log.rs:29:13
86 LL | let _ = (1.0 + x.powi(3)).ln();
87 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
89 error: ln(1 + x) can be computed more accurately
90 --> $DIR/floating_point_log.rs:30:13
92 LL | let _ = (1.0 + x.powi(3) / 2.0).ln();
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x.powi(3) / 2.0).ln_1p()`
95 error: ln(1 + x) can be computed more accurately
96 --> $DIR/floating_point_log.rs:31:13
98 LL | let _ = (1.0 + (std::f32::consts::E - 1.0)).ln();
99 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(std::f32::consts::E - 1.0).ln_1p()`
101 error: ln(1 + x) can be computed more accurately
102 --> $DIR/floating_point_log.rs:32:13
104 LL | let _ = (x + 1.0).ln();
105 | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
107 error: ln(1 + x) can be computed more accurately
108 --> $DIR/floating_point_log.rs:33:13
110 LL | let _ = (x.powi(3) + 1.0).ln();
111 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
113 error: ln(1 + x) can be computed more accurately
114 --> $DIR/floating_point_log.rs:34:13
116 LL | let _ = (x + 2.0 + 1.0).ln();
117 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x + 2.0).ln_1p()`
119 error: ln(1 + x) can be computed more accurately
120 --> $DIR/floating_point_log.rs:35:13
122 LL | let _ = (x / 2.0 + 1.0).ln();
123 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
125 error: ln(1 + x) can be computed more accurately
126 --> $DIR/floating_point_log.rs:43:13
128 LL | let _ = (1f64 + 2.).ln();
129 | ^^^^^^^^^^^^^^^^ help: consider using: `2.0f64.ln_1p()`
131 error: ln(1 + x) can be computed more accurately
132 --> $DIR/floating_point_log.rs:44:13
134 LL | let _ = (1f64 + 2.0).ln();
135 | ^^^^^^^^^^^^^^^^^ help: consider using: `2.0f64.ln_1p()`
137 error: ln(1 + x) can be computed more accurately
138 --> $DIR/floating_point_log.rs:45:13
140 LL | let _ = (1.0 + x).ln();
141 | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
143 error: ln(1 + x) can be computed more accurately
144 --> $DIR/floating_point_log.rs:46:13
146 LL | let _ = (1.0 + x / 2.0).ln();
147 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
149 error: ln(1 + x) can be computed more accurately
150 --> $DIR/floating_point_log.rs:47:13
152 LL | let _ = (1.0 + x.powi(3)).ln();
153 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
155 error: ln(1 + x) can be computed more accurately
156 --> $DIR/floating_point_log.rs:48:13
158 LL | let _ = (x + 1.0).ln();
159 | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
161 error: ln(1 + x) can be computed more accurately
162 --> $DIR/floating_point_log.rs:49:13
164 LL | let _ = (x.powi(3) + 1.0).ln();
165 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(3).ln_1p()`
167 error: ln(1 + x) can be computed more accurately
168 --> $DIR/floating_point_log.rs:50:13
170 LL | let _ = (x + 2.0 + 1.0).ln();
171 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x + 2.0).ln_1p()`
173 error: ln(1 + x) can be computed more accurately
174 --> $DIR/floating_point_log.rs:51:13
176 LL | let _ = (x / 2.0 + 1.0).ln();
177 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x / 2.0).ln_1p()`
179 error: aborting due to 29 previous errors