Not sure how many bits of arithmetic are being assumed there, but shift would also have a modulus effect. If I'm right, and if it's 32 bit, n << 21 might be like n mod 512 * 2^21. I just made this: http://staff.funnygarbage.com/colin/mapcalc.swf It will let you play with values while you try to work out the relationships!