I'm hoping someone could explain to me on how to use bit flags. I have a situation that requires me to see if a bit on a flag is set. How do you do that using bitwise operators? I've seen the explanation somewhere but I can't seem to find it.
Say I have a 5 bit flag. I know each bit value is 1,2,4,8 and 16 respectively. This is from a set in MySQL so I need to determine if the last bit is set within the set even if there are others set within the flag. Do I need to change the number that results from the set to binary first or can I use a bit opperator to see if the last bit is flipped or not?