On Fri, Dec 11, 2009 at 2:26 PM, Zsbán Ambrus <[email protected]> wrote: > round =: p:@:(i.>./)@:(_&q:)"0
Actually, given Dan's last message in this thread, I would have done something like: roundest=: p:@(i. >./)@(+/)@:q:~&_ This base maximizes the number of trailing zeros from that list of numbers. roundest 90 10 54 6 3 3 #.inv 90 10 54 6 1 0 1 0 0 0 0 1 0 1 0 2 0 0 0 0 0 0 2 0 Six trailing zeros in this case, where a base of 2 would give four trailing zeros. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
