Each operator has a precedence number assigned to it that determines the order in which
the operator and its operands are evaluated. The precedence numbers range from 1 (the
highest precedence, that is, first evaluated) to 7 (the lowest precedence, that is, last
evaluated)。
The following rules determine how expressions are evaluated:
● The highest precedence operators are evaluated first, then the second highest
precedence operators, and so on until the lowest precedence operators are evaluated.
● Operators of equal precedence are evaluated from left to right in the expression.
● Parentheses ( and ) can be used for grouping operators and operands and for
controlling the order in which the expressions are evaluated. For example, the
folloin exression ealuates to
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !