approx icon indicating copy to clipboard operation
approx copied to clipboard

Approximate floating point equality comparisons and assertions

Results 30 approx issues
Sort by recently updated
recently updated
newest added

Mirrors the slice implementation. Improves ergonomics when comparing arrays.

The documentation currently is not very clear as to how it computes things, and one reason I think is that nearly all the example just compare whether `1.0` is approximately...

This library appears to be the de-facto standard for approximate comparisons. Downstreams include [ndarray](https://github.com/rust-ndarray/ndarray) and [nalgebra](https://github.com/dimforge/nalgebra). I just ran into an issue where ndarray is using an older version tied...

In data science use cases, the most frequent test is to assert approximate equality of entire float data vectors. For instance in Numpy based code, testing with [`assert_allclose`](https://numpy.org/doc/stable/reference/generated/numpy.testing.assert_allclose.html#numpy.testing.assert_allclose) is ubiquitous....

Currently, the output is indistinguishable from `assert_eq!`'s: ``` thread 'bsf::tests::score_examples' panicked at 'assert_ulps_eq!(scores[0], 590.0798357956826, max_ulps = 1) left = 590.0798357956824 right = 590.0798357956826 ', src/bsf.rs:354:9 ``` It would be nicer...

Seeing as this repository seems to be getting some love now (thank you to @sebcrozet in particular!!), I'm wondering if it would be a good idea to transfer it to...

Delegating to the existing slice impls. Without these impls we could just compare two vecs as slices, but: - It requires the `&v[..]` or `v.as_slice()` syntax, on both sides of...

Consider this small example: ```rust let diff: f32 = 1.0e-7; let x: f32 = 1.0e-5; let y = x - diff; assert_ne!(x, y); relative_eq!(x, y) // returns true, but should...

Values of types `Option` and `Result` are frequently checked for equality in testing, but `approx` does not currently implement its traits on these types. This PR aims to do just...