运算符优先级和整除求模.docVIP

  • 58
  • 0
  • 约2.72千字
  • 约 4页
  • 2017-06-08 发布于重庆
  • 举报
运算符优先级和整除求模

请重点理解运算符的优先级和正负数之间的整除与mod运算。 运算符优先级,下面有对应的题目 Precedence of operators(运算符优先级) Operator(运算符) Precedence(优先级) Category(类别) Not, @ Highest first Unary operators(单目运算符) * / div mod and shl shr Second Multiplying operators(乘除运算符) + - or xor Third Adding operators(加减运算符) in Lowest Last relational operators(关系运算符) @ 取变量或函数的地址 返回一个指针 比如,下面这个运算: a : g 3 + f 2 ; f 2 有可能在g 3 之前执行,这和Turbo Pascal是不一样的。 g 3 在f 2 之前执行,只能通过临时变量人工的把表达式分隔开来,写成: e1 : g 3 ; a? : e1 + f 2 ; 算数运算符里面值得注意的是:Mod 和 Div。 官方文档中的一句话: The sign of the result of a Mod operator is the same as the sign of the left side operand of t

文档评论(0)

1亿VIP精品文档

相关文档