Bitwise operators can only process (Signed/unsigned) random, short integer, and integer variable constant literal values, but cannot perform decimal operations. You can also perform Operator Overloading in the class.
When there are too many threads, there are too many threads, too many threads.
Operator Function
── ─
& Bit logic and
| Bit logic or
^ Bit logic exclusive or
-Bit logic inversion
> Right shift
<Move left
When there are too many threads, there are too many threads, too many threads.
& Bit logic and
PhaseTrue and false. Others are false.
| Bit logic or
By phase or, same as falseIs false, and others are true.
^ Bit logic exclusive or
Bitwise difference or, the difference is true, the same is false.
-Bit logic inversion
Returns the inverse of each digit.
> Right shift
Remove the symbol bit of the data to add an original symbol (it can also be understood as adding a symbol to the highest data bit without changing the symbol bit)
Example: positive number 0010 0000 0000> 1 1011 0001 0000 0000
Negative 1000 0000 0000 0000> 1 1100 0000 0000 0000
<Move left
The highest bit of data is removed. The lowest Bit is 0.
Example:Positive number 0010 0000 0000 1011 <1 0100 0000 0001 0110
Negative1000 0000 0000 0000<1 0000 0000 0000 0000
Note that data is stored in the computer in the form of a complement.
For signed data, the highest bit indicates that the sign bit 0 represents a positive number 1 represents a negative number.
The positive and reverse completion codes of positive numbers are consistent.
The negative number is the inverse of each digit of the positive code (except the symbol bit), and the complement is the last digit + 1 of the reverse code.