Here's a funny thing:
  a=.0j0 _1j0 _4j0 _9j0 _16j0
  3!:0 a
4
  b=.*:j.i.5
  3!:0 b
16

a gets coerced to integer while b remains complex. And I remain puzzled by the behavior of plot. If you give plot a vector of complex numbers, it appears to plot the imaginary part vs. the real part, and it does not mind if the real parts = 0; j.i.5 is plotted as x=0. Given that b is complex with the imaginary parts = 0, why does it not plot y=0 instead of failing?


Raul Miller wrote:
On Wed, Aug 13, 2008 at 2:01 PM, Eldon Eller <[EMAIL PROTECTED]> wrote:
Thank you, Dominic. I assumed that was what you intended.  I am surprised
that *:j.i.5 is complex, since it is purely real. It prints as real: 0 _1 _4
_9 _16 instead of 0j0 _1j0 _4J0 _9j0 _16j0. J, like life, is mysterious.

For the most part, J concerns itself with arithmetic properties, and
not the inner details of the way numbers are represented.

However, for whatever reason, plot uses 3!:0 to determine what it
should be doing (rather than letting the user control this, and rather
than using an expression like *./,0={:+.y)

Of course using plot&([EMAIL PROTECTED] ::]L: 0) works around this problem.

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

Reply via email to