Why not just multiply/divide by a power of 2? Bitshifting in such a high-level language won't offer any performance gains, if that's what you want it for.