| ResourceFunction["BitFlip"][*n,p*]
flips the pth bit of integer n. |

## Details and Options

The lowest bit of integer *n* (e.g. signifying 2^{0}) is flipped with p=0.

## Examples

### Basic Examples

Flip the 0th bit of the number 2, from a zero to a one:

Flip the 0th bit of the number 3, from a one to a zero:

Starting with the number zero, flip positional bits:

### Scope

Flip the bit associated with 2^{4}:

Flip the bit associated with 2^{7}:

### Applications

Compute the Hamming-distance between a random integer and the same number with a single random bit flipped:

## Publisher Information