

Zero Divided by Zero (2003) - ScottWRobinson
http://www.jsoftware.com/papers/zero.htm

======
mehrdada
> ((D%C)+(B%C)) = (D+B) % C

This is wrong. You need an extra %C on the left hand side for that identity to
work:

((D%C)+(B%C))%C = (D+B) % C

~~~
edmccard
In the J programming language, '%' is the division operator (not the modulus).
So the identity is correct

~~~
mehrdada
Thanks, I missed it. My bad.

------
TazeTSchnitzel
I prefer the IEEE 754 solution: NaN.

~~~
TheLoneWolfling
I find that the bane of my existence.

It is _far_ better in almost all cases to have it be something vaguely
sensible than to have it pop out a virus that infects everything down the
line.

~~~
TazeTSchnitzel
> I find that the bane of my existence.

Then don't use it. You can trap it, you know.

> It is far better in almost all cases to have it be something vaguely
> sensible than to have it pop out a virus that infects everything down the
> line.

It isn't better, because now your program produces incorrect results and you
don't know about it.

~~~
TheLoneWolfling
For game programming, it is decidedly better to produce subtly incorrect
results, at least on a release build, than NaN everywhere.

~~~
yoklov
In game programming you want it to be 0 as often as you want it to be 1 (or
really, less often).

Just write a safeDiv function that takes an argument for what the result
should be if the denominator is zero.

------
jordigh
I read the introduction. They want to assign a real value to 0/0\. From a
flawed premise no true conclusion can be drawn, so I stopped reading.

~~~
effie
I share your sentiment, just a nitpick: from a flawed premise any conclusion,
true or false, can be drawn.
[http://academic.csuohio.edu/polen/LC9_Help/1/14ftv.htm](http://academic.csuohio.edu/polen/LC9_Help/1/14ftv.htm)

