Announcing `float_eq` 0.3.0

Hi!

I've just published version 0.3.0 of float_eq, for comparing floating point values.

Notable changes include a much more rigorous and consistent treatment of special floating point values, so ULPs checks now respect NaNs, and infinities are correctly handled.

Epsilons for composite types may now be provided on a per-field basis:

assert_float_eq!(a, b, ulps <= Complex32Ulps { re: 2, im: 4 });
assert_float_eq!([1.0, -2.0], [-1.0, -2.5], abs <= [2.0, 0.5]);
assert_float_eq!((1.0f32, 2.0f64), (-1.0, 2.5), abs <= (2.0, 0.5));

Or, where applicable, uniformly across all fields:

assert_float_eq!(a, b, ulps_all <= 4);
assert_float_eq!([1.0, -2.0], [-1.0, -2.5], abs_all <= 2.0);

There is also now support for tuples (of up to size 12, inclusive), with more support for standard types planned.

Plus a variety of other fixes and tweaks, see the CHANGELOG for more details.

Constructive criticism and feedback appreciated, I hope you're having a lovely day :slight_smile:

3 Likes