I'm using a book to learn C++ and I don't understand its explanation on how to find the enumerator's range. The explanation is as follows:
The range is defined as follows:First, to find the upper limit, you take the largest enumerator value. Then you find the smallest power of two greater than this largest value and subtract one. The result is the upper end of the range. (For example, the largest bigstep value, as previously defined, is 101. The smallest power of two greater than this is 128, so the upper end of the range is 127.)
Next, to find the lower limit, you find the smallest enumerator value. If it is 0 or greater, the lower limit for the range is 0. If the smallest enumerator is negative, you use the same approach for finding the upper limit but toss in a minus sign.(For example, if the smallest enumerator is -6, the next power of two [times a minus sign] is -8, and the lower limit is -7)
The reference to "the largest bigstep value" refers to a enum declaration earlier.
The part that I get lost on is when it refers to "find the smallest power of..."