Table of Contents

Method FlipBit

Namespace
Zyl.ExSpans.Impl
Assembly
ExSpans.dll

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 uint

The value.

index int

The 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 ulong

The value.

index int

The 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.