4 ms·
Can't you just use mod(x, 1:n)? Or mod(i, eachindex(vals))?
by conistonwater 6y ago
Can't you just use mod(x, 1:n)? Or mod(i, eachindex(vals))?
- shele 6y agoLol, this is so nice. It is literally what OP asked for: " modulo to remain within some range" is just mod(myvalue, myrange)