]> git.lizzy.rs Git - rust.git/blob - tests/ui/float_cmp.stderr
Merge pull request #2364 from flip1995/precedence
[rust.git] / tests / ui / float_cmp.stderr
1 error: strict comparison of f32 or f64
2   --> $DIR/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   --> $DIR/float_cmp.rs:43:5
10    |
11 43 |     ONE == 1f32;
12    |     ^^^^^^^^^^^
13
14 error: strict comparison of f32 or f64
15   --> $DIR/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: std::f32::EPSILON and std::f64::EPSILON are available.
21   --> $DIR/float_cmp.rs:44:5
22    |
23 44 |     ONE == 1.0 + 0.0;
24    |     ^^^^^^^^^^^^^^^^
25
26 error: strict comparison of f32 or f64
27   --> $DIR/float_cmp.rs:45:5
28    |
29 45 |     ONE + ONE == ZERO + ONE + ONE;
30    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE + ONE - (ZERO + ONE + ONE)).abs() < error`
31    |
32 note: std::f32::EPSILON and std::f64::EPSILON are available.
33   --> $DIR/float_cmp.rs:45:5
34    |
35 45 |     ONE + ONE == ZERO + ONE + ONE;
36    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
38 error: strict comparison of f32 or f64
39   --> $DIR/float_cmp.rs:46:5
40    |
41 46 |     ONE != 2.0;
42    |     ^^^^^^^^^^ help: consider comparing them within some error: `(ONE - 2.0).abs() < error`
43    |
44 note: std::f32::EPSILON and std::f64::EPSILON are available.
45   --> $DIR/float_cmp.rs:46:5
46    |
47 46 |     ONE != 2.0;
48    |     ^^^^^^^^^^
49
50 error: strict comparison of f32 or f64
51   --> $DIR/float_cmp.rs:48:5
52    |
53 48 |     twice(ONE) != ONE;
54    |     ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(twice(ONE) - ONE).abs() < error`
55    |
56 note: std::f32::EPSILON and std::f64::EPSILON are available.
57   --> $DIR/float_cmp.rs:48:5
58    |
59 48 |     twice(ONE) != ONE;
60    |     ^^^^^^^^^^^^^^^^^
61
62 error: strict comparison of f32 or f64
63   --> $DIR/float_cmp.rs:49:5
64    |
65 49 |     ONE as f64 != 2.0;
66    |     ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE as f64 - 2.0).abs() < error`
67    |
68 note: std::f32::EPSILON and std::f64::EPSILON are available.
69   --> $DIR/float_cmp.rs:49:5
70    |
71 49 |     ONE as f64 != 2.0;
72    |     ^^^^^^^^^^^^^^^^^
73
74 error: strict comparison of f32 or f64
75   --> $DIR/float_cmp.rs:54:5
76    |
77 54 |     x == 1.0;
78    |     ^^^^^^^^ help: consider comparing them within some error: `(x - 1.0).abs() < error`
79    |
80 note: std::f32::EPSILON and std::f64::EPSILON are available.
81   --> $DIR/float_cmp.rs:54:5
82    |
83 54 |     x == 1.0;
84    |     ^^^^^^^^
85
86 error: strict comparison of f32 or f64
87   --> $DIR/float_cmp.rs:57:5
88    |
89 57 |     twice(x) != twice(ONE as f64);
90    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(twice(x) - twice(ONE as f64)).abs() < error`
91    |
92 note: std::f32::EPSILON and std::f64::EPSILON are available.
93   --> $DIR/float_cmp.rs:57:5
94    |
95 57 |     twice(x) != twice(ONE as f64);
96    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
98 error: aborting due to 8 previous errors
99