Wait... don't these have different results? Marshall
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of R.E. Boss Sent: Wednesday, September 01, 2010 2:42 AM To: 'Programming forum' Subject: Re: [Jprogramming] Splitting an integer into its digits > > > > Since 10&#.^:_1 is indeed faster than "."0@":"0 (which I did not > > expect, as the latter is listed under special code), this gives the > > fastest > execution > > yet. > > > > (...) > > > > > > rank~ '10&#.^:_1 d';'"."0@": d'[d=:i.1e5 > > +-----------+----+-------+-----+------+ > > |expression |rank|tm*sz |time |size | > > +-----------+----+-------+-----+------+ > > |10&#.^:_1 d| 0 | 1.00| 1.00| 1.00| > > +-----------+----+-------+-----+------+ > > |"."0@": d | 1 |2374.99|20.12|118.05| > > +-----------+----+-------+-----+------+ > > > > > > Typo? > > "."0@": > is (very) different from > "."0@":"0 > I used the code from http://www.jsoftware.com/help/release/digits10.htm ("."0@": Improved). To complete the story: rank~ '10&#.^:_1 d';'"."0@": d';'".@":"0 d';'"."0@":"0 d'[d=:i.1e5 +-----------+----+-------+-----+------+ |expression |rank|tm*sz |time |size | +-----------+----+-------+-----+------+ |10&#.^:_1 d| 0 | 1.00| 1.00| 1.00| +-----------+----+-------+-----+------+ |"."0@": d | 3 |2420.59|20.50|118.05| +-----------+----+-------+-----+------+ |".@":"0 d | 2 | 19.04| 5.06| 3.77| +-----------+----+-------+-----+------+ |"."0@":"0 d| 1 | 11.58| 1.49| 7.77| +-----------+----+-------+-----+------+ R.E. Boss ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
