If you try to shift a bitset by a multiple of 32 bits, you get incorrect answers. It is to do with the fact that usually 1>>32 == 1. Sincerely, Tomek