You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reject unequal infinities in approximate floating-point comparisons #555
After the exact-equality and NaN checks, approx_eq_f32/f64 computes abs(a-b) <= max(abs(a),abs(b))*relative_tolerance. Comparing positive infinity with 1.0 using a finite positive relative tolerance makes both sides infinite, so the result is true. Opposite infinities have the same problem. The early exact-equality check only handles equal infinities.
Overflow in the difference or scaled tolerance also needs consideration for extreme finite operands.
Reject unequal non-finite operands after retaining the existing equal-value behavior.
Cover equal/opposite infinities, infinity versus finite values, NaNs and signed zero for both float widths.
Avoid false positives caused solely by overflow in intermediate finite comparisons.
State and test handling of negative/NaN/infinite tolerances without silently broadening the comparison.
Audit status: static source inspection against canonical master ea74c2dafc31da876e5561f2d176ba719f5a0458 on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.
Activity
fix: preserve numeric results, file data, and I/O deadlines (wavefnd#631