That's the odometer function, no?  You have already given us (#: i.@:(*/)) y .  I don't want to do anything to put users in mind of ({ y) which can get out of hand quickly.

In the thread, we were looking for the nonzero values of y, so (4 $. $.) is spot on.

Henry Rich

On 11/13/2020 10:54 PM, Roger Hui wrote:
Another candidate is >,{i.&.>$x .  (4 $. $.) has the "problem" that indices
corresponding to 0 elements are excluded.



On Fri, Nov 13, 2020 at 6:59 PM Henry Rich <[email protected]> wrote:

Ric Sherlock has suggested that (4 $. $.) would be an idiom worthy of
special code.  I agree & will do it sometime.


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


--
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to