approx
approx copied to clipboard
Require the epsilon value (tolerance) to be specified explicitly, and remove the default
As @Andlon explains:
I'm not sure if it's actually wise to provide a default epsilon/tolerance - this is the very problem that Bruce Dawson discusses in the randomascii blog I know we've both spent some time reading. The problem with absolute differences is that there is really no sensible default - it depends entirely on the numbers you are comparing.
Note that I was referring explicitly to the absolute difference test for equality in that code, by the way. A default tolerance makes more sense for relative/ulp-based comparison.
Right! Thanks for the clarification.
What do you think a good default epsilon would be for ulps and relative?
Which epsilon do you mean, exactly? The absolute difference for comparing near-zero numbers that Bruce Dawson advocates in his blog, or the tolerance used for comparison with relative error or ULPs respectively?
IIRC, I think the defaults you've already been using in this crate have been fairly sane.