It is possible. A is the original data array.
]A=:at2"0 /~ i:2
_2.35619 _2.67795 3.14159 2.67795 2.35619
_2.03444 _2.35619 3.14159 2.35619 2.03444
_1.5708 _1.5708 0 1.5708 1.5708
_1.10715 _0.785398 0 0.785398 1.10715
_0.785398 _0.463648 0 0.463648 0.785398
]B=:":at2"0 /~ i:2
_2.35619 _2.67795 3.14159 2.67795 2.35619
_2.03444 _2.35619 3.14159 2.35619 2.03444
_1.5708 _1.5708 0 1.5708 1.5708
_1.10715 _0.785398 0 0.785398 1.10715
_0.785398 _0.463648 0 0.463648 0.785398
C=:(":"1,.,A),"1 ' '
D=: >(<"0)5 5$<"1 C
E=:'0. '(<2 3 4;2;i.10)} >D
]F=:5 50$,E
_2.35619 _2.67795 3.14159 2.67795 2.35619
_2.03444 _2.35619 3.14159 2.35619 2.03444
_1.5708 _1.5708 0. 1.5708 1.5708
_1.10715 _0.785398 0. 0.785398 1.10715
_0.785398 _0.463648 0. 0.463648 0.785398
G=:'0 '(<2 3 4;2;i.10)} >D
]H=:5 50$,G
_2.35619 _2.67795 3.14159 2.67795 2.35619
_2.03444 _2.35619 3.14159 2.35619 2.03444
_1.5708 _1.5708 0 1.5708 1.5708
_1.10715 _0.785398 0 0.785398 1.10715
_0.785398 _0.463648 0 0.463648 0.785398
G aligns 0. Under 3.
H just aligns 0 under the 3 (my choice)
I don't know how this could be adapted to format any data array.
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Friday, August 01, 2014 12:16 AM
To: [email protected]
Subject: [Jprogramming] FW: zero is an integer
I sent this to New Zealand by mistake.
From: Linda Alvord [mailto:[email protected]]
Sent: Tuesday, July 29, 2014 9:29 AM
To: ([email protected])
Subject: zero is an integer
Here is a numerical data array. Since 0 is an integer, shouldn't it be
aligned under the three in the last 4 rows?
at2=: 13 :'([:{:"1 *.) j./"1 y'
at2 /~ i:3
_2.35619 _2.55359 _2.81984 3.14159 2.81984 2.55359 2.35619
_2.1588 _2.35619 _2.67795 3.14159 2.67795 2.35619 2.1588
_1.89255 _2.03444 _2.35619 3.14159 2.35619 2.03444 1.89255
_1.5708 _1.5708 _1.5708 0 1.5708 1.5708 1.5708
_1.24905 _1.10715 _0.785398 0 0.785398 1.10715 1.24905
_0.982794 _0.785398 _0.463648 0 0.463648 0.785398 0.982794
_0.785398 _0.588003 _0.321751 0 0.321751 0.588003 0.785398
I'm not sure it is possible, but the table would be much easier to read.
Lindaa
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm