I don't understand what's going on with this code:
if ((_value & item.Value) == item.Value) { item.IsSet = true; } In this particular example that I'm looking at, I'm seeing the following:
if _value is 4103 but item.Value is 0, it's true.
if _value is 4103 but item.Value is 1, it's true.
if _value is 4103 but item.Value is 2, it's true.
if _value is 4103 but item.Value is 4, it's true.
if _value is 4103 but item.Value is 8, it's not true.
if _value is 4103 but item.Value is 16, it's not true.
if _value is 4103 but item.Value is 256, it's not true.
if _value is 4103 but item.Value is 512, it's not true.
if _value is 4103 but item.Value is 1024, it's not true.
if _value is 4103 but item.Value is 2048 it's not true.
if _value is 4103 but item.Value is 4096, it's true.
In another example, I'm seeing the following:
if _value is 51 but item.Value is 0, it's true.
if _value is 51 but item.Value is 1, it's true.
if _value is 51 but item.Value is 2, it's true.
if _value is 51 but item.Value is 4, it's not true.
if _value is 51 but item.Value is 8, it's not true.
if _value is 51 but item.Value is 16, it's true.
if _value is 51 but item.Value is 32, it's true.
Can someone please explain it to me?