Method FlipBit
FlipBit(uint, int)
Flip the bit at a specific position in a given value. Similar in behavior to the x86 instruction BTC (Bit Test and Complement).
[CLSCompliant(false)]
public static uint FlipBit(uint value, int index)
Parameters
value
uintThe value.
index
intThe zero-based index of the bit to flip. Any value outside the range [0..31] is treated as congruent mod 32.
Returns
- uint
The new value.
FlipBit(ulong, int)
Flip the bit at a specific position in a given value. Similar in behavior to the x86 instruction BTC (Bit Test and Complement).
[CLSCompliant(false)]
public static ulong FlipBit(ulong value, int index)
Parameters
value
ulongThe value.
index
intThe zero-based index of the bit to flip. Any value outside the range [0..63] is treated as congruent mod 64.
Returns
- ulong
The new value.