幂运算符比在操作数左边的一元运算符有更高的优先级; 但比右面的一元运算符要低。句法为。
The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right. The syntax is.
在本例中,求幂运算符是另一种形式的二进制运算符,所以使用现有BinaryOp case类就可以。
In this case, the exponentiation operator is another form of binary operator so the existing BinaryOp case class serves.
因此, 在一串没有括号的由幂运算符和一元运算符组成的序列, 会从左到右面求值(没有强制改变求值顺序)。
Thus, in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left (this does not constrain the evaluation order for the operands).
应用推荐