( ,.&.": ) is indeed a neat phrase and you are right about the relative poor performance of ( 10&#.^:_1 ). Perhaps, for the reason that you mentioned, there is case for special code for ( 10&#.^:_1 ) .
The intellectual satisfaction though is that one can readily ask related questions. For example a Mayan question and its answer follow, 20 (>./)@(5 */\ #.^:_1) 73167176531330624919225119674426574742355349194934x 163072 or rather, 20 ,.@(#.^:_1) 163072 1 0 7 13 12 ________________________________ From: "Sherlock, Ric" <[email protected]> To: Programming forum <[email protected]> Sent: Sun, December 6, 2009 7:55:56 PM Subject: Re: [Jprogramming] digits (was: Code review / Euler) Just came across a nice version of "digits" in a Rosetta Code contribution by Arie Groeneveld: ,.&.": >./ 5 */\ ,.&.": 73167176531330624919225119674426574742355349194934x 10&#.^:_1 (or 10&#.inv ) has always seemed to me to be the "right" way of converting a number to its digits but it is slower and fatter than the other methods: ts=: 6!:2 , 7!:2...@] 40 ts ',.&.": 73167176531330624919225119674426574742355349194934x' 0.000115929383164 22016 40 ts '_&"."0 ": 73167176531330624919225119674426574742355349194934x' 0.000160654001302 18944 40 ts '(10&#.^:_1) 73167176531330624919225119674426574742355349194934x' 0.000466587187342 52608 > From: Jose Mario Quintana > > Another way, > > >./@(5 */\ 10&#.^:_1) > 73167176531330624919225119674426574742355349194934x > 6048 > > ________________________________ > From: "Sherlock, Ric" > > Note the redundant ( _&"."0 ": ) I should have removed from my code: > 5 */\ _&"."0 ": 73167176531330624919225119674426574742355349194934x > 882 126 294 1764 1470 ... ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
