I remember I asked a question 5 years ago in stack overflow[0] about the mathematical equation equivalent of bitwise AND. Thank you for posting this I found the answer to my 5 year old question.
[0] - http://stackoverflow.com/questions/7199625/mathematical-equa...