Hacker News new | ask | show | jobs
by kstrauser 847 days ago
You're right about the unexpected results in that case, but I'd bet good money that accidentally dividing by zero in code like `avg=sum(lst)/len(lst)` is far more common in standard Python code than dividing very small numbers.
1 comments

totally agreed, and its so common that some places like snowflake give you div0 and div0null to opt into just returning 0 or null in those cases