The Dictionary article on Constants

http://www.jsoftware.com/help/dictionary/dcons.htm

has the comment

"Furthermore, symbols at the same level of the hierarchy cannot be used together: 1p2x3 is an ill-formed number."

Kip Murray


Devon McCormick wrote:
Members of the Forum -

In Roger Stokes's "Learning J", chapter 19, he gives some examples to
illuminate the order in which embedded numeric modifiers (e.g. 1j1, 2r3,
1e2) are evaluated.

So, for example, from this experiment

   1e1r2
5
   1r1e2
0.01

we see that "e" is evaluated before "r".  Stokes gives the order of
evaluation, from first to last, as "erjpb".  However, he leaves out "x"
(where "AxB" is "A * ^ B").

I noticed this because I was trying to write an expression for the famous
identity "0 = 1 + e ^ (i*pi)", the rightmost part (after "+") we could write
in J as "^0j1p1", as "1x0j1p1" but I get the error "ill-formed number".
When I experimented to determine where "x" fits in the order given above, I
ran into this roadblock:

   1x1p1
|ill-formed number
   1p1x1
|ill-formed number

So, while I can combine the other letters ad ridiculum, e.g.

   1p1j1r2b3e2
51.209594j50.783502
   1x1j1r2b3e2
47.374206j36.898021

I can't have "x" and "p" in the same number.  Has this come up before?  Does
anyone know why this is?

Regards,

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

Reply via email to