Roger Hui <[email protected]> wrote:
> Historically, _8^%3 in APL gives _2 as the answer.
> But is this in violation of the 2001 ISO Standard
> on Extended APL.  I consider the _2 answer as
> an "Easter egg" tour de force by the original
> implementers (principally Larry Breed):
> For x^y where x is negative, assume y is
> positive.  (For negative y, replace x by %x
> and y by -y.)  The system computes a rational
> approximation of y of integers m and n with
> 1=gcd(m,n) .  If n is even, signal domain error;
> if n is odd, x^y is the real number (x^m)^%n .

This would be the best answer one could give in systems
that supported real numbers but not complex numbers
(APL\360 anyone?)
For systems that do both, this answer is nice only in
that it would be backwards-compatible with older systems,
but it would have the inconsistent ugliness that
(3%:_8) ~: (3%:_8 j.0) that violates the fairly pervasive
requirement that a-:b => (u a)-:(u b) in all but a few
well-defined cases.

-- Mark D. Niemiec <[email protected]>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to