Repository: brendanzab/approx (language: rust)

Issue:
less than or equal to
This line:

ulps_eq.rs:61
```rust
                $U::abs(int_self - int_other) < max_ulps as $U
```

uses strictly less than. However I'd like to make the argument for using <=, and also point out that it will change the behavior and should come with a version bump.

In the randomascii article, he uses `<=` exclusively throughout.  He comments about it in the comments below the article: https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/#li-comment-8342

Also, the similar lines of logic elsewhere in the crate use `<=` such as abs_diff_eq.rs and relative_eq using `<= epsilon`

If you use `<`, then anyone trying to do a comparison with max_ulps=0 and thinking this means the numbers must be exactly equal, would be suprised to see two exactly equal numbers coming out as not equal (because no absolute value is less than zero).  At the interface of the crate, however, this doesn't happen because the epsilon based comparsion kicks in and overrides.



Discussion / hints:

Fix patch:
diff --git a/src/ulps_eq.rs b/src/ulps_eq.rs
index a3abf4b..1e18483 100644
--- a/src/ulps_eq.rs
+++ b/src/ulps_eq.rs
@@ -58,7 +58,7 @@ macro_rules! impl_ulps_eq {
                 let int_self: $U = unsafe { mem::transmute(*self) };
                 let int_other: $U = unsafe { mem::transmute(*other) };
 
-                $U::abs(int_self - int_other) < max_ulps as $U
+                $U::abs(int_self - int_other) <= max_ulps as $U
             }
         }
     }


Test patch:
diff --git a/tests/ulps_eq.rs b/tests/ulps_eq.rs
index f5e5698..1a2ba38 100644
--- a/tests/ulps_eq.rs
+++ b/tests/ulps_eq.rs
@@ -226,16 +226,16 @@ mod test_f64 {
     fn test_mid() {
         assert_ulps_eq!(1.0000000000000001f64, 1.0000000000000002f64);
         assert_ulps_eq!(1.0000000000000002f64, 1.0000000000000001f64);
-        assert_ulps_ne!(1.000000000000001f64, 1.000000000000002f64);
-        assert_ulps_ne!(1.000000000000002f64, 1.000000000000001f64);
+        assert_ulps_ne!(1.000000000000001f64, 1.0000000000000022f64);
+        assert_ulps_ne!(1.0000000000000022f64, 1.000000000000001f64);
     }
 
     #[test]
     fn test_mid_neg() {
         assert_ulps_eq!(-1.0000000000000001f64, -1.0000000000000002f64);
         assert_ulps_eq!(-1.0000000000000002f64, -1.0000000000000001f64);
-        assert_ulps_ne!(-1.000000000000001f64, -1.000000000000002f64);
-        assert_ulps_ne!(-1.000000000000002f64, -1.000000000000001f64);
+        assert_ulps_ne!(-1.000000000000001f64, -1.0000000000000022f64);
+        assert_ulps_ne!(-1.0000000000000022f64, -1.000000000000001f64);
     }
 
     #[test]