The associativity of an operator defines the order in which operators of the same precedence are grouped (right-to-left or left-to-right).
操作符的结合性定义了相同优先级操作符组合的顺序(从右至左或从左至右)。
The logical operators have lower precedence than the individual comparison operators, which makes sense because the comparison has to be evaluated before the logical operator can be evaluated.
逻辑运算符的优先级低于单独的比较运算符,这一点意义重大,因为必须先计算比较运算符,然后才能计算逻辑运算符。
The actual precedence of the logical operators is given by the order these operators are presented in Table 2.
逻辑运算符的实际优先级就是表2中罗列这些运算符的顺序。
If looser-binding operators take as operands expressions using tighter-binding operators, precedence is handled automatically.
如果松绑定(looser - binding)运算符使用紧绑定(tighter - binding)运算符作为操作数表达式,那么优先级是自动处理的。
The multiplication and division operators (the first four listed in Table 3) have higher precedence than the addition and subtraction operators.
乘法和除法运算符(表3中列出的前四个)具有高于加法和减法的优先级。
The available operators (grouped by increasing precedence) are summarized in Table 3.
可用的运算符(按照优先权分组)在表3中做了总结。
If the character is an operator, pop operators until you reach an opening parenthesis, an operator of lower precedence, or a right associative symbol of equal precedence.
如果字符是个操作符,弹出(pop)操作符,直至遇见开括号(openingparenthesis)、优先级较低的操作符或者同一优先级的右结合符号。
The following operators carry their usual meaning, and are listed in order from lowest precedence, to the highest.
下述操作符使用它们通常的含义,依照最低到最高优先级的顺序被列出来。
Simply put, precedence stipulates how operands are grouped in expressions with multiple operators.
简单地说,优先级决定了有多个操作符的表达式如何对操作数分组。
Table 2.1 at the end of this chapter summarizes precedence and associativity for all operators.
本章末尾的表2-1完整总结了所有运算符的优先级和结合律。
That is, precedence and associativity determine which part of the expression is the operand for each of the operators in the expression.
也就是说,优先级和结合性决定了表达式的哪个部分用作哪个操作符的操作数。
If the operators all have the same precedence, then the order of evaluation depends on their associativity.
如果所有操作符优先级一样,那么求值顺序就取决于它们的结合性。
Unfortunately, most tools for reformatting code are blind to the precedence of operators and impose the same spacing throughout.
不幸的是,多数代码格式化工具都会漠视运算符优先级,从头到尾采用同样的空格方式。
Some of the operators have the wrong precedence; some parts of the syntax could be better.
有一些运算符的优先级不合适;语法的一些部分还可以做得更好。
The arithmetic and concatenation operators have the order of precedence described in the following section, and all have greater precedence than the comparison, logical, and bitwise operators.
算术和串连运算子优先顺序如下节所述,其优先顺序都高于比较运算子、逻辑运算子和位元运算子。
Associativity specifies how to group operators at the same precedence level.
结合性规定了具有相同优先级的运算符如何进行分组。
Provides a table that lists operators and corresponding precedence and an example of how operator precedence works.
提供一个列出运算子、对应的优先顺序的资料表,以及一个运算子优先顺序运作方式的范例。
As in mathematics, a sequence of operands and operators is evaluated according to a set of precedence and association rules.
优先级和关系规则和数学中是一样的,一系列的操作按照一种优先级和关系规则来先后进行计算。
The conditional operator has lower precedence than bitwise operators.
条件运算符的优先级比按位运算符的优先级低。
Include parentheses to establish precedence of operators.
包含括号以建立运算子的优先顺序。
Include parentheses to establish precedence of operators.
包含括号以建立运算子的优先顺序。
应用推荐