c++ algorithm modulus
===

How could I easily check whether a <= b <= a+c, modulus 256 (where we take the values for a and a+c that are the closest to b) ?

I know the question isn't very clear, sorry about that, but I'm having trouble to explain clearly what it does, otherwise that would be the answer to my own question.

Here is a try, but it's maybe not much clearer, sorry:

Basically, given b, I take its representative value modulus 256 that is between 0 and 255, and then I take the value for a modulus 256 that is the closest to b. At this point, if a is not less than b, the check should fail. Otherwise try and see whether b is also less than a+c (where no modulus operation is applied this time on a+c).

My actual problem is that I receive a value (b) that is implemented as a char (up to 256 possibilities before cycling), and I have to check whether it is greater than the expected value (a) (it can't be less than the expected value) (great and less are here to be understood as the closest representatives of these values, because <= and >= shouldn't exist in modulus operations) , but no greater than the sum of a and the error allowed (c).

Sorry for sounding so confused, feel free to ask for details and I'll update the question.