首先可以用位运算符替代纯数学操作。
The first is to use bitwise operations instead of pure mathematical operations.
描述控制位运算符的操作数强制的规则。
Describes the rules that govern the coercion of the operands of bitwise operators.
条件运算符的优先级比按位运算符的优先级低。
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.
在以下关于锁定机制的讨论中,我们首先看一下原子运算符,它可以保护简单变量(计数器和位掩码(bitmask))。
In the following review of locking mechanisms, we first look at the atomic operators, which provide protection for simple variables (counters and bitmasks).
Mix()运算符(Hadamard 运算符)用于处于 |0>状态的位时,将会象上面的例子一样把状态转变成sqrt(0.5)(|0>+|1>) 。
The Mix() operator (Hadamard operator) when applied to a bit in the |0> state will transform the state into sqrt(0.5)(|0>+|1>) as in the example above.
如果被测试表达式中应当包含按位或运算符,则应当在条件表达式的两侧加上括号。
If the tested expression should contain the bitwise-or operator, then parentheses should be added around the conditional-expression.
运算符对数值执行常见计算,其中包括将数值的位模式移位。
Arithmetic Operators perform familiar calculations on numeric values, including shifting their bit patterns.
按位或向结果表达式添加位,而按位与只选择两个运算符之间相同的位。
Bitwise-or adds bits to the resulting expression, whereas bitwise-and selects only those bits in common between its two operators.
按位或向结果表达式添加位,而按位与只选择两个运算符之间相同的位。
Bitwise-or adds bits to the resulting expression, whereas bitwise-and selects only those bits in common between its two operators.
应用推荐