2 ms·
And that's one reason that when I write code that divides and it's not known ahead of time, I usually check the denominator for zero. Doing that for every math
by asveikau 6y ago
And that's one reason that when I write code that divides and it's not known ahead of time, I usually check the denominator for zero.
Doing that for every mathematical operation would not be feasible.
Edit: hello good sir or madam downvoter, can someone explain why this is a controversial opinion? In languages where this error does not throw exceptions and in problem domains where the process really needs to stay up, reasonable caution would often mean you might manually check possible denominators for zero.