条件运算符的优先级比按位运算符的优先级低。
The conditional operator has lower precedence than bitwise operators.
按位运算符强制。
然而,按位运算符和移位运算符永远不会导致溢出。
However, bitwise operators and shift operators never cause overflow.
按位运算符会对两个自变量中对应的位执行布尔代数,并最终生成一个结果。
Bitwise operators perform Boolean algebra on the corresponding bits in the two arguments to produce the result.
对一个表达式执行按位“取非”(求非)运算。
按位或向结果表达式添加位,而按位与只选择两个运算符之间相同的位。
Bitwise-or adds bits to the resulting expression, whereas bitwise-and selects only those bits in common between its two operators.
如果被测试表达式中应当包含按位或运算符,则应当在条件表达式的两侧加上括号。
If the tested expression should contain the bitwise-or operator, then parentheses should be added around the conditional-expression.
不包含式按位异或意味着,如果两个运算数相应比特位不同,其结果为1,否则结果为0。下表显示异或运算结果。
Exclusive or means that if the two operand bits are different the result is 1, otherwise the result is 0. The following table shows the results of an exclusive or operation.
不包含式按位异或意味着,如果两个运算数相应比特位不同,其结果为1,否则结果为0。下表显示异或运算结果。
Exclusive or means that if the two operand bits are different the result is 1, otherwise the result is 0. The following table shows the results of an exclusive or operation.
应用推荐