Closed jtempest closed 4 years ago
Suggestion: Fold FloatDiff
into FloatEqDebug
and rename it something like AssertFloatEqDebug
. Also consider changing it to be a formatted output trait like Debug
itself, rather than returning types that must be formatted themselves.
This has been resolved by https://github.com/jtempest/float_eq-rs/commit/f8090cf5993dbf2484de10066ab0cb14e622548c.
The library needs to decide whether Ulps types are fully fledged types intended for numeric manipulation, or if they are strictly debugging aids. For example, the
MyComplex32
examples don't take into account what happens if one or more members have a valid difference in ULPs but the others do not. For example, given this call:Should the result be
None
, orMyComplex32 { re: Some(0), im: None }
. The former would appear to be more useful from a numerical algorithm standpoint, and the latter from a debugging standpoint. Given thatfloat_eq
is primarily a debugging aid (andFloatDiff
already leans this way), I think it should be explicit about the diffs being for debugging, and thus more granularly specified.