← Back to context Comment by bondarchuk 6 years ago I'm not sure I get it, can you give an example of "index into a table of linearly increasing values"? 2 comments bondarchuk Reply 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. bondarchuk 6 years ago Aha, thanks for the explanation!
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. bondarchuk 6 years ago Aha, thanks for the explanation!
say you want to represent values going from -10 to 10 with a step of 2 you'll have an array which is
-> "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.
Aha, thanks for the explanation!