]> git.lizzy.rs Git - rust.git/blob - tests/ui/float_cmp.stderr
Add float cmp tests for arrays
[rust.git] / tests / ui / float_cmp.stderr
1 error: strict comparison of `f32` or `f64`
2   --> $DIR/float_cmp.rs:65:5
3    |
4 LL |     ONE as f64 != 2.0;
5    |     ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE as f64 - 2.0).abs() > error`
6    |
7    = note: `-D clippy::float-cmp` implied by `-D warnings`
8 note: `f32::EPSILON` and `f64::EPSILON` are available.
9   --> $DIR/float_cmp.rs:65:5
10    |
11 LL |     ONE as f64 != 2.0;
12    |     ^^^^^^^^^^^^^^^^^
13
14 error: strict comparison of `f32` or `f64`
15   --> $DIR/float_cmp.rs:70:5
16    |
17 LL |     x == 1.0;
18    |     ^^^^^^^^ help: consider comparing them within some error: `(x - 1.0).abs() < error`
19    |
20 note: `f32::EPSILON` and `f64::EPSILON` are available.
21   --> $DIR/float_cmp.rs:70:5
22    |
23 LL |     x == 1.0;
24    |     ^^^^^^^^
25
26 error: strict comparison of `f32` or `f64`
27   --> $DIR/float_cmp.rs:73:5
28    |
29 LL |     twice(x) != twice(ONE as f64);
30    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(twice(x) - twice(ONE as f64)).abs() > error`
31    |
32 note: `f32::EPSILON` and `f64::EPSILON` are available.
33   --> $DIR/float_cmp.rs:73:5
34    |
35 LL |     twice(x) != twice(ONE as f64);
36    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
38 error: strict comparison of `f32` or `f64`
39   --> $DIR/float_cmp.rs:93:5
40    |
41 LL |     NON_ZERO_ARRAY[i] == NON_ZERO_ARRAY[j];
42    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(NON_ZERO_ARRAY[i] - NON_ZERO_ARRAY[j]).abs() < error`
43    |
44 note: `f32::EPSILON` and `f64::EPSILON` are available.
45   --> $DIR/float_cmp.rs:93:5
46    |
47 LL |     NON_ZERO_ARRAY[i] == NON_ZERO_ARRAY[j];
48    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
50 error: strict comparison of `f32` or `f64`
51   --> $DIR/float_cmp.rs:98:5
52    |
53 LL |     a1 == a2;
54    |     ^^^^^^^^
55    |
56 note: `f32::EPSILON` and `f64::EPSILON` are available.
57   --> $DIR/float_cmp.rs:98:5
58    |
59 LL |     a1 == a2;
60    |     ^^^^^^^^
61
62 error: strict comparison of `f32` or `f64`
63   --> $DIR/float_cmp.rs:99:5
64    |
65 LL |     a1[0] == a2[0];
66    |     ^^^^^^^^^^^^^^ help: consider comparing them within some error: `(a1[0] - a2[0]).abs() < error`
67    |
68 note: `f32::EPSILON` and `f64::EPSILON` are available.
69   --> $DIR/float_cmp.rs:99:5
70    |
71 LL |     a1[0] == a2[0];
72    |     ^^^^^^^^^^^^^^
73
74 error: aborting due to 6 previous errors
75