It's not a bug. In n >> m, it only looks at the last five bits of m - so any number greater than 31 will be reduced to that number mod 32. So, (256 >> 37) == 8 is true.
Edit: This is true if you're working with ints. If it's longs, then it looks at the last six bits of m, or mods by 64.