Eugene almost has it right:
The SHARP APL Reference Manual, in describing "Division by Zero", says:
"As in arithmetic, dividing a non-zero quantity by zero is undefined and
the interpreter rejects it as a domain error. However, to preserve some
convenient identities, SHARP APL defines 0{divide}0 to be 1.*
*{footnote} "A Dictionary of APL" follows McDonnell's argument that
0{divide}0
should be 0 ("Zero Divided by Zero," ACM Quote-Quad APL76, pp. 295-302).
However,
the convention that 0{divide}0 is 1 was adopted by all early
implementations of APL,
and is included in the ISO standard for APL."
The ISO standard was intended to enshrine existing behavior, when most
or
all implementations had the same behavior, so we did not have much
wiggle room
here.
Bob
On Wed, 2008-01-09 at 14:34 -0800, Eugene McDonnell wrote:
> On Jan 9, 2008, at 11:22 AM, Devon McCormick wrote:
>
> > At least according to this guy:
> > http://www.bbc.co.uk/berkshire/content/articles/2006/12/12/nullity_061212_feature.shtml
> >
> > .
> >
> > --
> > Devon McCormick, CFA
> > ^me^ at acm.
> > org is my
> > preferred e-mail
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> I've just reread my article "Zero Divided by Zero" in APL76
> Proceedings, and it gives the case that 0%0 is 0. I still believe that
> the quotient should be zero, for if it is one, the least common
> multiple function fails, the distributivity of division over addition
> fails; the arc (or phase, amplitude, argument or angle) fails; the
> dyadic logarithm has a problem; as does the average of an empty
> vector ; lastly, with the complex domain in view, zero is the only
> symmetrical choice. It was persuasive to Ken Iverson, who saw its
> truth, and saw to it that APL gave the zero value, as does J.
>
> Eugene
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm