Protect against division by zero during floating-point comparisons