2020-08-28 14:10:16 +00:00
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:7:5
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | (a - b) < f32::EPSILON
|
|
|
|
| -------^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b).abs()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::float-equality-without-abs` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::float_equality_without_abs)]`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:18:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = (a - b) < f32::EPSILON;
|
|
|
|
| -------^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:20:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a - b < f32::EPSILON;
|
|
|
|
| -----^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:22:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a - b.abs() < f32::EPSILON;
|
|
|
|
| -----------^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b.abs()).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:24:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = (a as f64 - b as f64) < f64::EPSILON;
|
|
|
|
| ---------------------^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a as f64 - b as f64).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:26:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = 1.0 - 2.0 < f32::EPSILON;
|
|
|
|
| ---------^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(1.0 - 2.0).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:29:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = f32::EPSILON > (a - b);
|
|
|
|
| ^^^^^^^^^^^^^^^-------
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:31:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = f32::EPSILON > a - b;
|
|
|
|
| ^^^^^^^^^^^^^^^-----
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:33:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = f32::EPSILON > a - b.abs();
|
|
|
|
| ^^^^^^^^^^^^^^^-----------
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a - b.abs()).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:35:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = f64::EPSILON > (a as f64 - b as f64);
|
|
|
|
| ^^^^^^^^^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(a as f64 - b as f64).abs()`
|
|
|
|
|
|
|
|
error: float equality check without `.abs()`
|
2024-06-18 17:34:49 +00:00
|
|
|
--> tests/ui/float_equality_without_abs.rs:37:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = f32::EPSILON > 1.0 - 2.0;
|
|
|
|
| ^^^^^^^^^^^^^^^---------
|
|
|
|
| |
|
|
|
|
| help: add `.abs()`: `(1.0 - 2.0).abs()`
|
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|