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 will be rounded using complex floor, while in reality each component of the quotient is (tolerantly) rounded independently.

Henry Rich






On 6/22/2017 4:53 PM, Louis de Forcrand wrote:
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).
However, this is untrue for
'x y'=: 1j1 3j4
(tested on the old J for iOS)

While it would seem like a logical extension, the dictionnary only says that 
this is true for rational numbers.

So how is the residue of two complex numbers defined in J?

Thanks,
Louis
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


---
This email has been checked for viruses by AVG.
http://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to