magila
Joined 14 years ago
Karma
1,993
Submissions
376
Member since
Jun 8
Joined 14 years ago
Another common example of this is circular buffers. Computing the bounded index from an arbitrary index is simply i % c with zero based indexing, but becomes (i-1) % c + 1 with one based indexing.