Well, if we can agree that (-<.) -: 1&| , then these rules are already proving inconsistent.
1 | 0.6j0.6 _0.4j_0.4 (-<.) 0.6j0.6 _0.4j0.6 Here is the model I'm currently aiming for: 1&| for reals is defined as the function which shifts by an integer such that (0<:1&|) and (1>1&|) 1&| -: 1&|&.+. b&| -: 1&|&.(%&b) <. -: (- 1&|) ($0)&#: -: ($0)"_ (bs,b)&#: -: ((bs #: <.@%&b),b&|) NB. bs a list, b a scalar These definitions are consistent with current definitions for real numbers and provide a very natural extension to complex numbers. Furthermore they have the desirable property that <.@:(-&0.5j0.5) gives the nearest complex number to the argument. However, they're still up for revision if someone can convince me either that the current definition of <. makes sense or that the current definitions are used in important code that would break under this remodeling. Marshall On Sun, Jan 22, 2012 at 12:49 PM, Don Guinn <dongu...@gmail.com> wrote: > The thing is that floor, ceiling, residue and antibase are related and all > should be handled by the same rules, whatever they may be. > > On Sun, Jan 22, 2012 at 10:38 AM, Marshall Lochbaum <mwlochb...@gmail.com > >wrote: > > > I'm pretty sure I understand the definition, but I still don't get the > > rationale. Under my scheme the "obvious" complex floor would be (- 1&|), > > which also has the properties of convexity, translatability, and > > compatibility listed in the dictionary. > > > > Marshall > > > > On Sun, Jan 22, 2012 at 12:08 PM, Henry Rich <henryhr...@nc.rr.com> > wrote: > > > > > 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