Wrap an Index

Operators ยท medium

Implement `wrapIndex(i, len)` returning `i` wrapped into the range `0..len-1`, handling negative indices.

Loading...

Run your code to see results.