Set a bit
value |= 1 << position;
Unset a bit
value &= ~(1 << position);
Toggle a bit
value ^= 1 << position;
Check a bit
isSet = value & (1 << position);
Set a bit
value |= 1 << position;
Unset a bit
value &= ~(1 << position);
Toggle a bit
value ^= 1 << position;
Check a bit
isSet = value & (1 << position);