A recent thread moved to chat, "more fork examples", looks at timings for high powers of BIGNUMs. The following suggests a speedup is possible (at least in J6.02, to which I'm restricted until my life settles down - sorry!) ---------------------------------------------------------------------------------------
intpower=: 3 : 0 2x intpower y : a=. 1 [ xp=. x for_k. |. }. #: y do. if. k do. a=. a*xp end. xp=. *: xp end. a*xp ) ts 'p0=: 9223372036854775807x ^ 10000' 16.3665 5.43642e6 ts 'p1=: 9223372036854775807x intpower 10000' 5.94679 1.71008e6 p0 = p1 1 --------------------------------------------------------------------------------------- The current J6.02 timings are similar to what I get with an extra, redundant xp=. *: xp after the calculation. Again apologies if this is sorted in J7/8. Best wishes, Ewart Ewart Shaw (Dr. J.E.H.Shaw) Department of Statistics, University of Warwick. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm