My attempt is to increase the performance of my JavaScript application by finding the bitwise equivalence of x mod 289
My code looks like this: lookupArray[x % 289]
and x will always be in the range from 0 to 288, so I don't have to worry about negative numbers.
So basically I have a lookup array of the size 288, so if x goes above 288 it will start again from 0. I could increase the array size and repeat some of the lookup numbers if there's no bitwise equivalence for the number 289, but for some larger number instead. But what number would that be?
If the size of my lookup table was smaller, for example 240, then I would be able to use 255, but that's too low for my case.
Thanks!