On Feb 15, 2011, at 01:03 PM, Tom Browder <tom.browder@...> wrote:
Sean, thanks for correcting my FP comparison "fixes."
Note that I did see the ZERO and EQUAL macros in vmath.h and
considered using them but the comment for both there says:
"Use not recommended due to compilation-variant tolerance."
Perhaps the notes should be removed or changed to:
"Use is recommended when FP comparisons are absolutely necessary."
The wording is probably not optimal or could be expanded, but the issue isn't really whether to use them or not. It's that the tolerance lacks definition for both ZERO(val) and NEAR_ZERO(val, FLT_MIN) or NEAR_ZERO(val, SMALL_FASTF). It basically means "we don't know the actual tolerance to compare with, but compare with as minimal difference as this compilation thinks is possible."
So in light of there being no difference between the two, we can opt for the simpler/shorter version, even though the comparison is still just as compilation-variant and ill-defined. Otherwise, it's the same thing.
One more point. Do you mean to keep ZEROTOL and "foo > ZEROTOL" in
firpass.c (which seems to go against your other changes)?
I didn't review the file that closely for all tolerance issues. At a glance, it looks like it has a slew of hard-coded tolerance values embedded so I wouldn't be inclined to changing them without reviewing the code and testing them with inputs.