Consider using parentheses to improve readability and avoid mistakes because of logical operator precedence.
考虑使用括号来改善可读性和避免由于逻辑操作符的优先级导致的错误。
The logical operators have lower precedence than the individual comparison operators, which makes sense because the comparison has to be evaluated before the logical operator can be evaluated.
逻辑运算符的优先级低于单独的比较运算符,这一点意义重大,因为必须先计算比较运算符,然后才能计算逻辑运算符。
什么是逻辑算子?
A logical operator that consists of a logical and followed by a logical NOT and returns a false value only if both operands are true.
由逻辑与和其后的逻辑非组成的逻辑运算符,如果两个运算域都是真,则返回的值便为假。
A logical operator that consists of a logical and followed by a logical NOT and returns a false value only if both operands are true.
由逻辑与和其后的逻辑非组成的逻辑运算符,如果两个运算域都是真,则返回的值便为假。
应用推荐