bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Power Operator


From: Juergen Sauermann
Subject: Re: [Bug-apl] Power Operator
Date: Wed, 13 Aug 2014 12:23:29 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi Blake,

thanks. Negative powers build on  the concept of an "inverse function".

In GNU APL some of the primitives have inverse functions (+/- ×/÷, ⋆/⍟ and ○).

But these inverse functions have rather strange effects, for example:

      2 (+ ⍣ 40) 5
85
      2 (- ⍣ ¯40) 5
85
      2 (+ ⍣ ¯40) 5
5
      2 (- ⍣ ¯40) 5
85

In the context of APL operators (+\ in the Dyalog example), the determination of the
inverse function can get very complicated and is undefined in most cases. Given
that I will no go down too far on the road to inverse functions.

When I read about the power operator for the first time (around GNU APL 1.2 or so),
it was the concept of inverse functions that made me think of ⍣ as a broken operator.

/// Jürgen


On 08/13/2014 01:53 AM, Blake McBride wrote:
Trying some of the examples in the Dyalog book I found the following:

Dialog book:
      (+\ ⍣  ̄¯1) 3 4 9 15 19
3 1 5 6 4


GNU APL:
      (+\ ⍣ ¯1) 3 4 9 15 19
DOMAIN ERROR
      (+\⍣¯1)3 4 9 15 19
      ^     ^


Blake McBride

www.arahant.com
Cell:    615-394-6760
Office:  615-376-5500
Fax:     615-377-6006




On Tue, Aug 12, 2014 at 12:32 PM, Juergen Sauermann <address@hidden> wrote:
Hi,

I have implemented the first shot at the power operator ⍣. SVN 434.

/// Jürgen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]