]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/float_cmp.stderr
05ee40397edeaf88a68b932df834e5304d1f5948
[rust.git] / clippy_tests / examples / float_cmp.stderr
1 error: strict comparison of f32 or f64
2   --> float_cmp.rs:43:5
3    |
4 43 |     ONE == 1f32;
5    |     ^^^^^^^^^^^ help: consider comparing them within some error `(ONE - 1f32).abs() < error`
6    |
7    = note: `-D float-cmp` implied by `-D warnings`
8 note: std::f32::EPSILON and std::f64::EPSILON are available.
9   --> float_cmp.rs:43:5
10    |
11 43 |     ONE == 1f32;
12    |     ^^^^^^^^^^^
13
14 error: strict comparison of f32 or f64
15   --> float_cmp.rs:44:5
16    |
17 44 |     ONE == 1.0 + 0.0;
18    |     ^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE - (1.0 + 0.0)).abs() < error`
19    |
20    = note: `-D float-cmp` implied by `-D warnings`
21 note: std::f32::EPSILON and std::f64::EPSILON are available.
22   --> float_cmp.rs:44:5
23    |
24 44 |     ONE == 1.0 + 0.0;
25    |     ^^^^^^^^^^^^^^^^
26
27 error: strict comparison of f32 or f64
28   --> float_cmp.rs:45:5
29    |
30 45 |     ONE + ONE == ZERO + ONE + ONE;
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE + ONE - (ZERO + ONE + ONE)).abs() < error`
32    |
33    = note: `-D float-cmp` implied by `-D warnings`
34 note: std::f32::EPSILON and std::f64::EPSILON are available.
35   --> float_cmp.rs:45:5
36    |
37 45 |     ONE + ONE == ZERO + ONE + ONE;
38    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
40 error: strict comparison of f32 or f64
41   --> float_cmp.rs:46:5
42    |
43 46 |     ONE != 2.0;
44    |     ^^^^^^^^^^ help: consider comparing them within some error `(ONE - 2.0).abs() < error`
45    |
46    = note: `-D float-cmp` implied by `-D warnings`
47 note: std::f32::EPSILON and std::f64::EPSILON are available.
48   --> float_cmp.rs:46:5
49    |
50 46 |     ONE != 2.0;
51    |     ^^^^^^^^^^
52
53 error: strict comparison of f32 or f64
54   --> float_cmp.rs:48:5
55    |
56 48 |     twice(ONE) != ONE;
57    |     ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(ONE) - ONE).abs() < error`
58    |
59    = note: `-D float-cmp` implied by `-D warnings`
60 note: std::f32::EPSILON and std::f64::EPSILON are available.
61   --> float_cmp.rs:48:5
62    |
63 48 |     twice(ONE) != ONE;
64    |     ^^^^^^^^^^^^^^^^^
65
66 error: strict comparison of f32 or f64
67   --> float_cmp.rs:49:5
68    |
69 49 |     ONE as f64 != 2.0;
70    |     ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE as f64 - 2.0).abs() < error`
71    |
72    = note: `-D float-cmp` implied by `-D warnings`
73 note: std::f32::EPSILON and std::f64::EPSILON are available.
74   --> float_cmp.rs:49:5
75    |
76 49 |     ONE as f64 != 2.0;
77    |     ^^^^^^^^^^^^^^^^^
78
79 error: strict comparison of f32 or f64
80   --> float_cmp.rs:54:5
81    |
82 54 |     x == 1.0;
83    |     ^^^^^^^^ help: consider comparing them within some error `(x - 1.0).abs() < error`
84    |
85    = note: `-D float-cmp` implied by `-D warnings`
86 note: std::f32::EPSILON and std::f64::EPSILON are available.
87   --> float_cmp.rs:54:5
88    |
89 54 |     x == 1.0;
90    |     ^^^^^^^^
91
92 error: strict comparison of f32 or f64
93   --> float_cmp.rs:57:5
94    |
95 57 |     twice(x) != twice(ONE as f64);
96    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(x) - twice(ONE as f64)).abs() < error`
97    |
98    = note: `-D float-cmp` implied by `-D warnings`
99 note: std::f32::EPSILON and std::f64::EPSILON are available.
100   --> float_cmp.rs:57:5
101    |
102 57 |     twice(x) != twice(ONE as f64);
103    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
105 error: aborting due to previous error(s)
106
107 error: Could not compile `clippy_tests`.
108
109 To learn more, run the command again with --verbose.