I have a need of wrapping an int to a specific range, via integer underflow. For example, if the value is greater than x then set it back to its minimum value. I was able to do that part easily enough with a modulo/int overflow (x % max x value). I don’t know, however, how I should go about wrapping it back to its max value when it is lower than its minimum.
Thanks for the response, I guess that is the easiest way to do it. I am using the modulo for a 0 based index, I just thought there might’ve been a way to calculate it for the opposite direction/underflow.
