Two infrequent binary operators are the ~ (or 1's complement) and the ! (or NOT).

The 1's complement operator flips all the bits in a value, turning a 1 into a 0 and a 0 into a 1. For example:

~01010011 = 10101100

The ! (NOT) operator affects the entire value - all the bits. It changes any nonzero value to 0, and the value 0 to 1:

!01010011 = 00000000 !00000000 = 00000001

Zero and 1 are the only two results possible when using the bitwise ! operator.

Both the ~ and ! operators are unary operators.

- Bitwise Operators
- Using Bitwise Operators to check mask flag
- Mask to select multiple bits from a variable.
- Displaying binary values
- Using the bitwise | operator
- Use binary OR operator to change character case
- Using bitwise &
- Operating exclusively with XOR