如果所有操作符优先级一样,那么求值顺序就取决于它们的结合性。
If the operators all have the same precedence, then the order of evaluation depends on their associativity.
在这对括号中,找出优先级最高的操作符。
Inside that pair of parentheses, find the operator with highest priority.
操作符的优先级不相关。
步骤2:要实现求值的单步执行,W3Eval 在嵌套最深的那对括号中找出优先级最高的操作符。
Step 2: To perform a single step of an evaluation, W3Eval finds the operator with the highest priority inside the deepest nested pair of parentheses.
在后缀表达式中,不需要括号,而且操作符的优先级也不再起作用了。
In postfix notation, the need for parentheses is eliminated and the priority of the operators is no longer relevant. You can use the following algorithm to evaluate postfix expressions.
优先级或者说操作符的强度决定求值顺序;优先级高的操作符比优先级低的操作符先求值。
Precedence or operator strength determines order of evaluation; an operator with higher precedence is evaluated before one of lower precedence.
操作符的结合性定义了相同优先级操作符组合的顺序(从右至左或从左至右)。
The associativity of an operator defines the order in which operators of the same precedence are grouped (right-to-left or left-to-right).
考虑使用括号来改善可读性和避免由于逻辑操作符的优先级导致的错误。
Consider using parentheses to improve readability and avoid mistakes because of logical operator precedence.
如果字符是个操作符,弹出(pop)操作符,直至遇见开括号(openingparenthesis)、优先级较低的操作符或者同一优先级的右结合符号。
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.
下述操作符使用它们通常的含义,依照最低到最高优先级的顺序被列出来。
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.
是否真的有比前缀,后缀式操作符的优先级更高?
Does Postfix operator really has a higher precedence than prefix?
有一种书写表达式的方法叫做“完全括号”,这种表达式把每一个操作符都加了括号,表达完全精确,也不必记忆优先级规则。
This type of expression uses one pair of parentheses for each operator. Theparentheses dictate the order of operations; there is no ambiguity. There isalso no need to remember any precedence rules.
也就是说,优先级和结合性决定了表达式的哪个部分用作哪个操作符的操作数。
That is, precedence and associativity determine which part of the expression is the operand for each of the operators in the expression.
这个图表,看起来很烦,很无趣,但是它很有用,有非常明确的规定,譬如,当你写代码时,就会涉及操作符的优先级。
This chart, very boring and uninteresting but useful to say there are very well defined rules as to when you're writing code, what operators, like what syntax should get evaluated first.
操作符的优先级(第5.10.1节)、结合性或操作数目不能改变。
The precedence (Section 5.10.1, p. 168), associativity, or number of operands of an operator cannot be changed.
操作符的优先级(第5.10.1节)、结合性或操作数目不能改变。
The precedence (Section 5.10.1, p. 168), associativity, or number of operands of an operator cannot be changed.
应用推荐