isWrappedSet() currently incorrectly returns true for ranges like i8 [42, 255], also known as i8 [42, 0). While a reasonable person might argue that the current behavior is correct if you interpret "wrapping" relative to the exclusive upper bound, the behavior is inconsistent with isSignWrappedSet() in two ways:
- While i8 [42, 0) is considered unsigned wrapping, i8 [42, -128) is not considered signed wrapping.
- The full set is not considered unsigned wrapping, but considered signed wrapping.
This patch changes isWrappedSet() and isSignWrappedSet() to behave consistently: They will both not consider 0/SignedMin upper bound as wrapping, and both not consider full sets as wrapping.
Additionally isUpperWrapped() and isUpperSignWrapped() methods are added which *do* consider 0/SignedMin as wrapping. Both interpretations of wrapping are useful depending on context, so both are provided.
I should note that the use of isUpperWrapped() in this function is incorrect, I'm just using it to preserve the existing behavior. This function should be using isWrappedSet() and work on an inclusive upper bound. Right now it handles ranges with Upper=0 suboptimally. I will submit a followup for that.