]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/approx_const.rs
Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk
[rust.git] / src / tools / clippy / tests / ui / approx_const.rs
1 #[warn(clippy::approx_constant)]
2 #[allow(clippy::similar_names)]
3 fn main() {
4     let my_e = 2.7182;
5     let almost_e = 2.718;
6     let no_e = 2.71;
7
8     let my_1_frac_pi = 0.3183;
9     let no_1_frac_pi = 0.31;
10
11     let my_frac_1_sqrt_2 = 0.70710678;
12     let almost_frac_1_sqrt_2 = 0.70711;
13     let my_frac_1_sqrt_2 = 0.707;
14
15     let my_frac_2_pi = 0.63661977;
16     let no_frac_2_pi = 0.636;
17
18     let my_frac_2_sq_pi = 1.128379;
19     let no_frac_2_sq_pi = 1.128;
20
21     let my_frac_pi_2 = 1.57079632679;
22     let no_frac_pi_2 = 1.5705;
23
24     let my_frac_pi_3 = 1.04719755119;
25     let no_frac_pi_3 = 1.047;
26
27     let my_frac_pi_4 = 0.785398163397;
28     let no_frac_pi_4 = 0.785;
29
30     let my_frac_pi_6 = 0.523598775598;
31     let no_frac_pi_6 = 0.523;
32
33     let my_frac_pi_8 = 0.3926990816987;
34     let no_frac_pi_8 = 0.392;
35
36     let my_ln_10 = 2.302585092994046;
37     let no_ln_10 = 2.303;
38
39     let my_ln_2 = 0.6931471805599453;
40     let no_ln_2 = 0.693;
41
42     let my_log10_e = 0.4342944819032518;
43     let no_log10_e = 0.434;
44
45     let my_log2_e = 1.4426950408889634;
46     let no_log2_e = 1.442;
47
48     let log2_10 = 3.321928094887362;
49     let no_log2_10 = 3.321;
50
51     let log10_2 = 0.301029995663981;
52     let no_log10_2 = 0.301;
53
54     let my_pi = 3.1415;
55     let almost_pi = 3.14;
56     let no_pi = 3.15;
57
58     let my_sq2 = 1.4142;
59     let no_sq2 = 1.414;
60
61     let my_tau = 6.2832;
62     let almost_tau = 6.28;
63     let no_tau = 6.3;
64 }