logoalt Hacker News

miki12321110/11/20240 repliesview on HN

No.

In Python and languages with similar behavior, a division by 0 will immediately crash your program with a pretty stack trace, showing you exactly where the problem is and how the program got there.

In languages where division by 0 produces infinity, NaN, 0 or similar, your calculation just returns a nonsensical result.

Zero is even worse than inf or NaN, as you may not even realize that there was an error in the first place, as the result of your calculation is a number and not a strange-looking value.