⚠️ Warning: This is a draft ⚠️
This means it might contain formatting issues, incorrect code, conceptual problems, or other severe issues.
If you want to help to improve and eventually enable this page, please fork RosettaGit's repository and open a merge request on GitHub.
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
:: The task asks that division by zero be detected, but leaves open what to do at that point. The decision to return zero should be seen not as detection but as an (arbitrary but silly) decision about what to do after detection. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 14:40, 6 November 2015 (UTC)