in reply to Bitwise ops inconsistent

Excellent advice above. I'd add/enhance it by saying:
use integer;
might help, or use bit vectors;

-QM
--
Quantum Mechanics: The dreams stuff is made of