4 ms·
I would argue 1/0 is infinity. Not with mathematics, just logically. By using the wording "how many times does 0 go into 1?" You bring up 0/0. But 0/<anythi
by legohead 8y ago
I would argue 1/0 is infinity. Not with mathematics, just logically. By using the wording "how many times does 0 go into 1?"
You bring up 0/0. But 0/<anything> is already defined, it's 0. So 0/infinity = 0
Programmatically, I think I've always wanted X/0 to be 0. For example: progress bars, currency, or damage in a video game. It wouldn't be very helpful to have infinity be an answer there.
- banachtarski 8y agoYour argument is flawed because your zero is positively biased. Why infinity and why not negative infinity.
- deleted 8y ago[deleted]
- phyzome 8y agoI encourage you to look at the graphs. Yes, the value along the y-axis is 0, and the value along the x-axis approaches positive and negative infinity. It's path-dependent. Take a look.
- rurban 8y agoIn float yes. In int there's no Inf. There's only MAX_INT or 0 or throw an exception. Normal langs throw. That what the checked int div will do. But the unchecked int div has no return type which allows throwing an error. And pony is strongly typed, unlike most other langs. That's why it can guarantee much more safeties and performance than all other languages.