Talk:Detect division by zero
Many of the solutions here simply check that the result is infinite. This will fail if the numerator is 0 too, since 0 / 0 is mathematically incalculable (many languages return NaN here).
A correct pseudocode solution is:
result = numerator / denominator if numerator equals 0 if result is not a number divide by zero action end else if result is infinite divide by zero action end end