In a ealier question one coder came up with a nice solution.
A "Bitwise AND" (&) operator seems to be an option: