I also forgot the empty case (shame on me) so here they are again:
tgu=: 3 : 0
if. (0 e. $ y) do. y return. end.
ix=./:y
sy=.ix{y
p=.sy~:_1|.sy
one=.1
p=.one 0}p
sy=.p < ;.1 ix{i.#y
;(/:&.>sy){&.>sy
)
tgd=: 3 : 0
if. (0 e. $ y) do. y return. end.
ix=.\:y
sy=.ix{y
p=:sy~:_1|.sy
one=.1
p=.one 0}p
sy=.p < ;.1 ix{i.#y
;(\:&.>sy){&.>sy
)
Paul Gauthier
APL Software Developer - Senior
[EMAIL PROTECTED]
Phone: 312-739-3467
Fax: 312-739-3496
CheckFree. The Company that Powers Payment on the WebSM.
http://www.checkfree.com/paybillsonline
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm