]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/approx_const.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / approx_const.rs
1
2
3
4 #[warn(approx_constant)]
5 #[allow(unused, shadow_unrelated, similar_names)]
6 fn main() {
7 let my_e = 2.7182;
8 let almost_e = 2.718;
9 let no_e = 2.71;
10
11 let my_1_frac_pi = 0.3183;
12 let no_1_frac_pi = 0.31;
13
14 let my_frac_1_sqrt_2 = 0.70710678;
15 let almost_frac_1_sqrt_2 = 0.70711;
16 let my_frac_1_sqrt_2 = 0.707;
17
18 let my_frac_2_pi = 0.63661977;
19 let no_frac_2_pi = 0.636;
20
21 let my_frac_2_sq_pi = 1.128379;
22 let no_frac_2_sq_pi = 1.128;
23
24 let my_frac_pi_2 = 1.57079632679;
25 let no_frac_pi_2 = 1.5705;
26
27 let my_frac_pi_3 = 1.04719755119;
28 let no_frac_pi_3 = 1.047;
29
30 let my_frac_pi_4 = 0.785398163397;
31 let no_frac_pi_4 = 0.785;
32
33 let my_frac_pi_6 = 0.523598775598;
34 let no_frac_pi_6 = 0.523;
35
36 let my_frac_pi_8 = 0.3926990816987;
37 let no_frac_pi_8 = 0.392;
38
39 let my_ln_10 = 2.302585092994046;
40 let no_ln_10 = 2.303;
41
42 let my_ln_2 = 0.6931471805599453;
43 let no_ln_2 = 0.693;
44
45 let my_log10_e = 0.43429448190325182;
46 let no_log10_e = 0.434;
47
48 let my_log2_e = 1.4426950408889634;
49 let no_log2_e = 1.442;
50
51 let my_pi = 3.1415;
52 let almost_pi = 3.14;
53 let no_pi = 3.15;
54
55 let my_sq2 = 1.4142;
56 let no_sq2 = 1.414;
57 }