[Jprogramming] 5|0 1 2 3 4 is not equal to 5|0 1 2 3 4 j.0

Linda Alvord lindaalvord at verizon.net
Sun Jan 22 19:00:40 HKT 2012


   NB. j. y  ↔  0j1 * y 
   NB.   x j. y  ↔  x + j. y 
   
   f=: 13 :'5|y'
   f
5 | ]
 
   f 4
4
   4 j. 0 
4
   f 4 j. 0
_1

It seems to me that the code for  j.  fails to recognize that an entire array of numbers has right arguments of 0 and it should then convert the array to "real numbers". If it did that match would be correct. If match compares numbers it must check that both are real or both are imaginary.

Probably this is incredibly naïve, but those issues seems to be the problem.

Linda


Original Message-----
From: programming-bounces at jsoftware.com [mailto:programming-bounces at jsoftware.com] On Behalf Of David Mitchell
Sent: Sunday, January 22, 2012 4:42 AM
To: Programming forum
Subject: Re: [Jprogramming] 5|0 1 2 3 4 is not equal to 5|0 1 2 3 4 j.0

It also seems similar to this thread:

http://jsoftware.com/pipermail/programming/2011-December/026261.html


On 1/22/2012 4:23, Ian Clark wrote:
> This has similarities to the issues discussed in:
>    http://jsoftware.com/pipermail/programming/2011-July/023384.html
>
> On Sun, Jan 22, 2012 at 8:40 AM, Bo Jacoby<bojacoby at yahoo.dk>  wrote:
>> Equal arguments should give equal function values, but not here.
>>
>>     a=.i.5
>>     b=.a j. 0
>>     f=. 5&|
>>     a-:b
>> 1
>>     (f a)-:(f b)
>> 0
>>
>>     f a
>> 0 1 2 3 4
>>     f b
>> 0 1 2 _2 _1
>>
>> -Bo
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



More information about the Programming mailing list