Re: [Jprogramming] Complex residue

2017-06-22 Thread Henry Rich
I admit that the definition as it is implemented is less pretty than the one in Ye Dic. It would be easy to change the code to match the Dictionary definition - I just don't know if that would break existing code. Is that something we could thrash out here? Does anyone use complex residue?

Re: [Jprogramming] Complex residue

2017-06-22 Thread Don Kelly
This is from NuVoc (for 806) 1. For finite x, x | y is extended to negative numbers by the definition x|y ==> y-x*<. y % x+0=x and to complex numbers by the definition x|y ==> y-x* <.@(0.5&+)&.+. y % x+0=x . which agrees with your

Re: [Jprogramming] Complex residue

2017-06-22 Thread Raul Miller
Yeah... over time, I've probably argued at least three sides of this issue... -- Raul On Thu, Jun 22, 2017 at 6:21 PM, Henry Rich wrote: > I don't know which one is wrong. The Dictionary has errors and omissions, > and the implementation is what it is. I agree that they should be made > cons

Re: [Jprogramming] Complex residue

2017-06-22 Thread Henry Rich
I don't know which one is wrong. The Dictionary has errors and omissions, and the implementation is what it is. I agree that they should be made consistent. That's a work in progress. Henry Rich On 6/22/2017 5:58 PM, Raul Miller wrote: Since the dictionary defines the language, I think a b

Re: [Jprogramming] Complex residue

2017-06-22 Thread Raul Miller
Since the dictionary defines the language, I think a better way of stating the issue is that the implementation incorrectly does something different? Thanks, -- Raul On Thu, Jun 22, 2017 at 5:53 PM, Henry Rich wrote: > What it actually is (when x and y are not infinite and x is not 0) is > >

Re: [Jprogramming] Complex residue

2017-06-22 Thread Henry Rich
What it actually is (when x and y are not infinite and x is not 0) is d =. |x ab =. (+x) * y q =. <.@(0.5&+)&.+. ab%d y - x * q If my algebra is right, this is equivalent to (x|y)=y-x* <.@(0.5&+)&.+.y%x+0=x In other words, the Dictionary description incorrectly says that the complex quotient

[Jprogramming] Complex residue

2017-06-22 Thread Louis de Forcrand
Hi, There's been recent discussion on the GNU APL forums about how to define the residue function on complex arguments. I wondered how it was specified in J, but the dictionnary page seems kind of vague. Nuvoc says that (x|y)=y-x*<.y%x+0=x for all scalars x and y (including complex numbers). H