Here's a path to an answer: 10 10 10 10#:2345 2 3 4 5 (($":2345)#10) 10 10 10 10 (($":2345)#10)#:2345 2 3 4 5 f=: 13 :'(($":y)#10)#:y' f 2345 2 3 4 5 f ] #:~ 10 #~ [: $ ": Linda
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jon Hough Sent: Friday, May 09, 2014 2:33 AM To: [email protected] Subject: [Jprogramming] Base/antibase question I want to get the (base 10) digits of an integer as an array. e.g. 2343 becomes an array 2 3 4 3 My attempt is: tens =. 10 $ 10 tens #: 345 result: 0 0 0 0 0 0 0 3 4 5 I created the initial array tens as a 10 element array, and f course now I have way too many leading zeros in my result. How should I do this properly, returning no leading zeros, for an arbitrary size integer? Thanks. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
