I have bins where the ranges grow exponentially.
Bin 0 -> [0 <= x <= 10] (interval = 10)
Bin 1 -> [11 <= x <= 30] (interval = 20)
Bin 2 -> [31 <= x <= 70] (interval = 40)
Bin 3 -> [71 <= x <= 150] (interval = 80)
Bin 4 -> [151 <= x <= 310] (interval = 160)
... and so on.
The number of bins and first interval are known prior (in this case it is 5, and 10 respectively). x
lowest possible value is 0.
What I am currently doing is a standard for-loop that multiplies by 2 each time, and then return the index of the bin if value
is within the range.
Is there a smarter way of doing this?