Hacker News new | ask | show | jobs
by Giroflex 2871 days ago
Well, sometimes the average is 0, e.g. (-2 + 2)/2.

And the whole point is that this is meant to catch unforeseen interactions as soon as possible. If you add a check it's no longer unforeseen, and it may easily slip the programmer's mind.

1 comments

If I'm not mistaken, jeremyjh was referring to checking for 0 in the denominator, not the numerator.