This is a simple matter of priority.
From the sound of things, you assume that: 0x00000FF0 & 0x00000FF0 == 0x00000FF0; will be considered as: (0x00000FF0 & 0x00000FF0) == 0x00000FF0; , but in fact it is the same as: 0x00000FF0 & (0x00000FF0 == 0x00000FF0); .
In the latter case, the result is clearly false - == creates either 0 or 1 , and 0xff0 & 1 and 0xff0 & 0 , or both 0 values.
source share