How do you iterate backward over circular buffer without a conditional?

Viewed 4740

Iterating forward through a circular buffer without using a conditional is easy with the remainder operator...

iterator = (iterator + 1) % buffer_size;

I can't for the life of me figure out the reverse operation, iterating backward.

2 Answers
Related