]> git.lizzy.rs Git - rust.git/blob - tests/ui/float_cmp_const.stderr
add more negative tests
[rust.git] / tests / ui / float_cmp_const.stderr
1 error: strict comparison of f32 or f64 constant
2   --> $DIR/float_cmp_const.rs:16:5
3    |
4 16 |     1f32 == ONE;
5    |     ^^^^^^^^^^^ help: consider comparing them within some error: `(1f32 - ONE).abs() < error`
6    |
7    = note: `-D float-cmp-const` implied by `-D warnings`
8 note: std::f32::EPSILON and std::f64::EPSILON are available.
9   --> $DIR/float_cmp_const.rs:16:5
10    |
11 16 |     1f32 == ONE;
12    |     ^^^^^^^^^^^
13
14 error: strict comparison of f32 or f64 constant
15   --> $DIR/float_cmp_const.rs:17:5
16    |
17 17 |     TWO == ONE;
18    |     ^^^^^^^^^^ help: consider comparing them within some error: `(TWO - ONE).abs() < error`
19    |
20 note: std::f32::EPSILON and std::f64::EPSILON are available.
21   --> $DIR/float_cmp_const.rs:17:5
22    |
23 17 |     TWO == ONE;
24    |     ^^^^^^^^^^
25
26 error: strict comparison of f32 or f64 constant
27   --> $DIR/float_cmp_const.rs:18:5
28    |
29 18 |     TWO != ONE;
30    |     ^^^^^^^^^^ help: consider comparing them within some error: `(TWO - ONE).abs() < error`
31    |
32 note: std::f32::EPSILON and std::f64::EPSILON are available.
33   --> $DIR/float_cmp_const.rs:18:5
34    |
35 18 |     TWO != ONE;
36    |     ^^^^^^^^^^
37
38 error: strict comparison of f32 or f64 constant
39   --> $DIR/float_cmp_const.rs:19:5
40    |
41 19 |     ONE + ONE == TWO;
42    |     ^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE + ONE - TWO).abs() < error`
43    |
44 note: std::f32::EPSILON and std::f64::EPSILON are available.
45   --> $DIR/float_cmp_const.rs:19:5
46    |
47 19 |     ONE + ONE == TWO;
48    |     ^^^^^^^^^^^^^^^^
49
50 error: strict comparison of f32 or f64 constant
51   --> $DIR/float_cmp_const.rs:20:5
52    |
53 20 |     1 as f32 == ONE;
54    |     ^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(1 as f32 - ONE).abs() < error`
55    |
56 note: std::f32::EPSILON and std::f64::EPSILON are available.
57   --> $DIR/float_cmp_const.rs:20:5
58    |
59 20 |     1 as f32 == ONE;
60    |     ^^^^^^^^^^^^^^^
61
62 error: strict comparison of f32 or f64 constant
63   --> $DIR/float_cmp_const.rs:23:5
64    |
65 23 |     v == ONE;
66    |     ^^^^^^^^ help: consider comparing them within some error: `(v - ONE).abs() < error`
67    |
68 note: std::f32::EPSILON and std::f64::EPSILON are available.
69   --> $DIR/float_cmp_const.rs:23:5
70    |
71 23 |     v == ONE;
72    |     ^^^^^^^^
73
74 error: strict comparison of f32 or f64 constant
75   --> $DIR/float_cmp_const.rs:24:5
76    |
77 24 |     v != ONE;
78    |     ^^^^^^^^ help: consider comparing them within some error: `(v - ONE).abs() < error`
79    |
80 note: std::f32::EPSILON and std::f64::EPSILON are available.
81   --> $DIR/float_cmp_const.rs:24:5
82    |
83 24 |     v != ONE;
84    |     ^^^^^^^^
85
86 error: strict comparison of f32 or f64
87   --> $DIR/float_cmp_const.rs:34:5
88    |
89 34 |     v == w;
90    |     ^^^^^^ help: consider comparing them within some error: `(v - w).abs() < error`
91    |
92    = note: `-D float-cmp` implied by `-D warnings`
93 note: std::f32::EPSILON and std::f64::EPSILON are available.
94   --> $DIR/float_cmp_const.rs:34:5
95    |
96 34 |     v == w;
97    |     ^^^^^^
98
99 error: strict comparison of f32 or f64
100   --> $DIR/float_cmp_const.rs:35:5
101    |
102 35 |     v != w;
103    |     ^^^^^^ help: consider comparing them within some error: `(v - w).abs() < error`
104    |
105 note: std::f32::EPSILON and std::f64::EPSILON are available.
106   --> $DIR/float_cmp_const.rs:35:5
107    |
108 35 |     v != w;
109    |     ^^^^^^
110
111 error: strict comparison of f32 or f64
112   --> $DIR/float_cmp_const.rs:36:5
113    |
114 36 |     v == 1.0;
115    |     ^^^^^^^^ help: consider comparing them within some error: `(v - 1.0).abs() < error`
116    |
117 note: std::f32::EPSILON and std::f64::EPSILON are available.
118   --> $DIR/float_cmp_const.rs:36:5
119    |
120 36 |     v == 1.0;
121    |     ^^^^^^^^
122
123 error: strict comparison of f32 or f64
124   --> $DIR/float_cmp_const.rs:37:5
125    |
126 37 |     v != 1.0;
127    |     ^^^^^^^^ help: consider comparing them within some error: `(v - 1.0).abs() < error`
128    |
129 note: std::f32::EPSILON and std::f64::EPSILON are available.
130   --> $DIR/float_cmp_const.rs:37:5
131    |
132 37 |     v != 1.0;
133    |     ^^^^^^^^
134