Comment by jcelerier

6 years ago

say you want to represent values going from -10 to 10 with a step of 2 you'll have an array which is

    int array[]{-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10};

-> "0" is 6 in that case and you only need 4 bits to store your index. In addition in hardware it's somewhat common to have definitely non symmetrical ranges, e.g. from -20 to 150 or things like that.