Yup. When you use bitwise operators you don't get a boolean, you get the resulting bitmask. It just so happens that the resulting bit mask is also a number

And if the one thing you were testing it against was found then it should equal the same thing.