深入理解Solidity——运算符优先顺序

运算符优先顺序(Order of Precedence of Operators)

以下是按evaluation顺序列出的运算符优先顺序。

优先级 描述 运算符
1 Postfix increment and decrement ++, --
1 New expression new
1 Array subscripting []
1 Member access .
1 Function-like call ()
1 Parentheses ()
2 Prefix increment and decrement ++, --
2 Unary plus and minus +, -
2 Unary operations delete
2 Logical NOT !
2 Bitwise NOT ~
3 Exponentiation **
4 Multiplication, division and modulo *, /, %
5 Addition and subtraction +, -
6 Bitwise shift operators <<, >>
7 Bitwise AND &
8 Bitwise XOR ^
9 Bitwise OR |
10 Inequality operators <, >, <=, >=
11 Equality operators ==, !=
12 Logical AND &&
13 Logical OR ||
14 Ternary operator ? :
15 Assignment operators =, |=, ^=, &=, <<=, >>=, +=, -=, *=, /=, %=
16 Comma operator ,

上一篇:深入理解Solidity——提示和技巧

下一篇:深入理解Solidity——全局变量

你可能感兴趣的:(Solidity文档翻译系列,以太坊去中心化应用开发)