1 error: logarithm for bases 2, 10 and e can be computed more accurately
2 --> $DIR/floating_point_log.rs:9:13
4 LL | let _ = x.log(2f32);
5 | ^^^^^^^^^^^ help: consider using: `x.log2()`
7 = note: `-D clippy::floating-point-improvements` implied by `-D warnings`
9 error: logarithm for bases 2, 10 and e can be computed more accurately
10 --> $DIR/floating_point_log.rs:10: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:11: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:12: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:13: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:16:13
36 LL | let _ = x.log(2f64);
37 | ^^^^^^^^^^^ help: consider using: `x.log2()`
39 error: logarithm for bases 2, 10 and e can be computed more accurately
40 --> $DIR/floating_point_log.rs:17:13
42 LL | let _ = x.log(10f64);
43 | ^^^^^^^^^^^^ help: consider using: `x.log10()`
45 error: logarithm for bases 2, 10 and e can be computed more accurately
46 --> $DIR/floating_point_log.rs:18:13
48 LL | let _ = x.log(std::f64::consts::E);
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.ln()`
51 error: ln(1 + x) can be computed more accurately
52 --> $DIR/floating_point_log.rs:23:13
54 LL | let _ = (1.0 + x).ln();
55 | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
57 error: ln(1 + x) can be computed more accurately
58 --> $DIR/floating_point_log.rs:24:13
60 LL | let _ = (1.0 + x * 2.0).ln();
61 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x * 2.0).ln_1p()`
63 error: ln(1 + x) can be computed more accurately
64 --> $DIR/floating_point_log.rs:25:13
66 LL | let _ = (1.0 + x.powi(2)).ln();
67 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2).ln_1p()`
69 error: ln(1 + x) can be computed more accurately
70 --> $DIR/floating_point_log.rs:26:13
72 LL | let _ = (1.0 + x.powi(2) * 2.0).ln();
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x.powi(2) * 2.0).ln_1p()`
75 error: ln(1 + x) can be computed more accurately
76 --> $DIR/floating_point_log.rs:27:13
78 LL | let _ = (1.0 + (std::f32::consts::E - 1.0)).ln();
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `((std::f32::consts::E - 1.0)).ln_1p()`
81 error: ln(1 + x) can be computed more accurately
82 --> $DIR/floating_point_log.rs:34:13
84 LL | let _ = (1.0 + x).ln();
85 | ^^^^^^^^^^^^^^ help: consider using: `x.ln_1p()`
87 error: ln(1 + x) can be computed more accurately
88 --> $DIR/floating_point_log.rs:35:13
90 LL | let _ = (1.0 + x * 2.0).ln();
91 | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x * 2.0).ln_1p()`
93 error: ln(1 + x) can be computed more accurately
94 --> $DIR/floating_point_log.rs:36:13
96 LL | let _ = (1.0 + x.powi(2)).ln();
97 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2).ln_1p()`
99 error: x.log(b) / y.log(b) can be reduced to x.log(y)
100 --> $DIR/floating_point_log.rs:48:13
102 LL | let _ = x.log2() / y.log2();
103 | ^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
105 error: x.log(b) / y.log(b) can be reduced to x.log(y)
106 --> $DIR/floating_point_log.rs:49:13
108 LL | let _ = x.log10() / y.log10();
109 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
111 error: x.log(b) / y.log(b) can be reduced to x.log(y)
112 --> $DIR/floating_point_log.rs:50:13
114 LL | let _ = x.ln() / y.ln();
115 | ^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
117 error: x.log(b) / y.log(b) can be reduced to x.log(y)
118 --> $DIR/floating_point_log.rs:51:13
120 LL | let _ = x.log(4.0) / y.log(4.0);
121 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
123 error: x.log(b) / y.log(b) can be reduced to x.log(y)
124 --> $DIR/floating_point_log.rs:52:13
126 LL | let _ = x.log(b) / y.log(b);
127 | ^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
129 error: x.log(b) / y.log(b) can be reduced to x.log(y)
130 --> $DIR/floating_point_log.rs:54:13
132 LL | let _ = x.log(b) / 2f32.log(b);
133 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log2()`
135 error: x.log(b) / y.log(b) can be reduced to x.log(y)
136 --> $DIR/floating_point_log.rs:60:13
138 LL | let _ = x.log2() / y.log2();
139 | ^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
141 error: x.log(b) / y.log(b) can be reduced to x.log(y)
142 --> $DIR/floating_point_log.rs:61:13
144 LL | let _ = x.log10() / y.log10();
145 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
147 error: x.log(b) / y.log(b) can be reduced to x.log(y)
148 --> $DIR/floating_point_log.rs:62:13
150 LL | let _ = x.ln() / y.ln();
151 | ^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
153 error: x.log(b) / y.log(b) can be reduced to x.log(y)
154 --> $DIR/floating_point_log.rs:63:13
156 LL | let _ = x.log(4.0) / y.log(4.0);
157 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
159 error: x.log(b) / y.log(b) can be reduced to x.log(y)
160 --> $DIR/floating_point_log.rs:64:13
162 LL | let _ = x.log(b) / y.log(b);
163 | ^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
165 error: x.log(b) / y.log(b) can be reduced to x.log(y)
166 --> $DIR/floating_point_log.rs:66:13
168 LL | let _ = x.log(b) / 2f64.log(b);
169 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log2()`
171 error: aborting due to 28 previous errors