I believe match (-:) is OK. From the vocabulary: x -: y yields 1 if its arguments match: in shapes, boxing, and elements; but using tolerant comparison
It says nothing about type and uses tolerant comparison. -----Original Message----- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Linda Alvord Sent: Sunday, January 22, 2012 17:25 To: 'Programming forum' Subject: Re: [Jprogramming] 5|0 1 2 3 4 is not equal to 5|0 1 2 3 4 j.0 Since this is true, isn't match the problem? a=:i.5 b=:(i.5)j.0 3!:0 a 4 3!:0 b 16 Isn't it easy to insure that match will be false if one array is real and the other is complex? a-:b 1 So, what should the 5 residue of the complex list be? 5|b 0 1 2 _2 _1 Linda -----Original Message----- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Don Guinn Sent: Sunday, January 22, 2012 3:31 PM To: Programming forum Subject: Re: [Jprogramming] 5|0 1 2 3 4 is not equal to 5|0 1 2 3 4 j.0 a works like a real but it is still complex internally. 3!:0 a 16 On Sun, Jan 22, 2012 at 1:14 PM, Linda Alvord <lindaalv...@verizon.net>wrote: > How can you create a number in the complex plane that happens to lie on the > real axis? How do you keep its complexness? > > a=:(i.6)j.0 > a > 0 1 2 3 4 5 > > Even when you use j. the numbers have moved into the set of real numbers. > > Linda. > > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of Henry Rich > Sent: Sunday, January 22, 2012 12:09 PM > To: Programming forum > Subject: Re: [Jprogramming] 5|0 1 2 3 4 is not equal to 5|0 1 2 3 4 j.0 > > As Don said, make sure you understand complex floor before you start > coding. > > Henry Rich > > On 1/22/2012 11:38 AM, Marshall Lochbaum wrote: > > The theory of moduli is based on the quotient group of the integers by a > > subgroup. For instance, the integers (mod 2) are produced by taking all > the > > integers and identifying all the ones that are even, as well as all the > > ones that are odd. Then we get a two-element group which we can preform > > addition on: even+even=even, even+odd=odd, etc. > > > > To reduce a number in a particular modulus, we need to find a canonical > > representation for that number. For positive numbers n the choice is > fairly > > simple: n|l gives the l' such that 0<=l'<n. In the complex plane, a > number > > generates a grid by taking its product with the Gaussian integers; try > > 'dot; pensize 2' plot , 1j2 * j./~i:10 > > to see what I mean. Then what we want is a canonical form for what > happens > > when we identify all those points together. We're allowed to "shift" by > any > > Gaussian integer times the modulus. > > > > Based on this, I think a good way to calculate the modulus is to get the > > number into the square that lies counterclockwise of the modulus number. > > Practically, this means we decompose a complex number y into (a j.b)*x, > and > > then return (1|a)j.(1|b) . > > > > I'll see if I can get around to editing this. I have a working copy of > the > > source, but I haven't made sense of it entirely. > > > > Marshall > > > > On Sun, Jan 22, 2012 at 10:45 AM, Raul Miller<rauldmil...@gmail.com> > wrote: > > > >> Yes, this is a bug. > >> > >> Someone should fix it. > >> > >> J is open source. (Though distributed sources do not compile for me, > >> and I keep getting sidetracked when I investigate forks that might > >> compile.) > >> > >> -- > >> Raul > >> ---------------------------------------------------------------------- > >> 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 > > ---------------------------------------------------------------------- > 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm