Re:1/0 = 0
by ummonk on Saturday August 11, 2018 @02:25AM
(#17738626)
>If we assume that we got to 0 because of a rounding error we do know that it should be some positive integer.
That's assuming we had rounding error from a positive number, not a negative number. Of course, if you are concerned about rounding, you shouldn't be using integer arithmetic.
>1/(a number approaching 0) produces ever increasing integers.
No. It produces a bunch of 0s, except when the denominator is 1 (where it produces 1) or the denominator is -1 (where it produces -1). Unless you're using a language like Python, in which case it produces -1 for all negative denominators.
That's assuming we had rounding error from a positive number, not a negative number. Of course, if you are concerned about rounding, you shouldn't be using integer arithmetic.
>1/(a number approaching 0) produces ever increasing integers.
No. It produces a bunch of 0s, except when the denominator is 1 (where it produces 1) or the denominator is -1 (where it produces -1). Unless you're using a language like Python, in which case it produces -1 for all negative denominators.