位运算 Bitwise Algorithms
比特位操作函数表:
A | B | A OR B | A AND B | A XOR B | NOT A |
---|---|---|---|---|---|
1 | 1 | 1 | 1 | 0 | 0 |
1 | 0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 | 1 |
0 | 0 | 0 | 0 | 0 | 1 |
- BitOr,
|
- BitAnd,
&
- BitXor,
^
- BitNot,
~
- 左移,
<<
- 右移,
>>
比特位操作函数表:
A | B | A OR B | A AND B | A XOR B | NOT A |
---|---|---|---|---|---|
1 | 1 | 1 | 1 | 0 | 0 |
1 | 0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 | 1 |
0 | 0 | 0 | 0 | 0 | 1 |
|
&
^
~
<<
>>