fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.6 KiB68 linesraw
1error: strict comparison of `f32` or `f64` constant
2  --> $DIR/float_cmp_const.rs:16:5
3   |
4LL |     1f32 == ONE;
5   |     ^^^^^^^^^^^ help: consider comparing them within some margin of error: `(1f32 - ONE).abs() < error_margin`
6   |
7   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
8   = note: `-D clippy::float-cmp-const` implied by `-D warnings`
9   = help: to override `-D warnings` add `#[allow(clippy::float_cmp_const)]`
10
11error: strict comparison of `f32` or `f64` constant
12  --> $DIR/float_cmp_const.rs:19:5
13   |
14LL |     TWO == ONE;
15   |     ^^^^^^^^^^ help: consider comparing them within some margin of error: `(TWO - ONE).abs() < error_margin`
16   |
17   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
18
19error: strict comparison of `f32` or `f64` constant
20  --> $DIR/float_cmp_const.rs:22:5
21   |
22LL |     TWO != ONE;
23   |     ^^^^^^^^^^ help: consider comparing them within some margin of error: `(TWO - ONE).abs() > error_margin`
24   |
25   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
26
27error: strict comparison of `f32` or `f64` constant
28  --> $DIR/float_cmp_const.rs:25:5
29   |
30LL |     ONE + ONE == TWO;
31   |     ^^^^^^^^^^^^^^^^ help: consider comparing them within some margin of error: `(ONE + ONE - TWO).abs() < error_margin`
32   |
33   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
34
35error: strict comparison of `f32` or `f64` constant
36  --> $DIR/float_cmp_const.rs:29:5
37   |
38LL |     x as f32 == ONE;
39   |     ^^^^^^^^^^^^^^^ help: consider comparing them within some margin of error: `(x as f32 - ONE).abs() < error_margin`
40   |
41   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
42
43error: strict comparison of `f32` or `f64` constant
44  --> $DIR/float_cmp_const.rs:34:5
45   |
46LL |     v == ONE;
47   |     ^^^^^^^^ help: consider comparing them within some margin of error: `(v - ONE).abs() < error_margin`
48   |
49   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
50
51error: strict comparison of `f32` or `f64` constant
52  --> $DIR/float_cmp_const.rs:37:5
53   |
54LL |     v != ONE;
55   |     ^^^^^^^^ help: consider comparing them within some margin of error: `(v - ONE).abs() > error_margin`
56   |
57   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
58
59error: strict comparison of `f32` or `f64` constant arrays
60  --> $DIR/float_cmp_const.rs:71:5
61   |
62LL |     NON_ZERO_ARRAY == NON_ZERO_ARRAY2;
63   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64   |
65   = note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
66
67error: aborting due to 8 previous errors
68