I usually check before any division if the number equals 0,
if (number == 0) {
number = 1;
}
That's what I do.
What do you do? Throw exception?
I usually check before any division if the number equals 0,
if (number == 0) {
number = 1;
}
That's what I do.
What do you do? Throw exception?
Other urls found in this thread:
libdivide.com
gist.github.com
github.com
gnu.org
rohitab.com
twitter.com
Fuck off
of course i throw an exception giving out a wrong answer is absolutely retarded
>Having operations that naturally lend themselves for errors
>Allowing the exact single case of problematic input that fucks shit up
>Not throwing an exception on the exceptional case these operations somehow get to happen anyway despite your safeguards
>Instead, you fucking change variables under the hood unknown to everyone not looking the code
Your kind of pajeet solutions usually result in planes crashing
This is bait
just don't use division, problem solved
Add some epsilon just to be sure
Recursive substraction of integers?
That's even more retarded
use l’hopital’s rule