The bitwise NOT operator is a fundamental operator in computer science and digital electronics,
used to manipulate data at the bit level.
This operator is represented by the symbol ~ in most programming languages.
It performs a unary NOT operation on a binary number,
inverting each bit to produce a new binary number as the result.
The bitwise NOT operator works by inverting each bit of its operand.
If a bit is 0, the result at that position is 1;
if a bit is 1, the result at that position is 0.
Input | Output |
---|---|
0 | 1 |
1 | 0 |