Operator Precedence¶
This list is sorted by precedence, so upper entries bind stronger than lower ones.
Category Operators
Index accessors [], []?
Unary +, &+, -, &-, !, ~
Exponential **, &**
Multiplicative *, &*, /, //, %
Additive +, &+, -, &-
Shift <<, >>
Binary AND &
Binary OR/XOR |,^
Equality and Subsumption ==, !=, =~, !~, ===
Comparison <, <=, >, >=, <=>
Logical AND &&
Logical OR ||
Range .., ...
Conditional ?:
Assignment =, []=, +=, &+=, -=, &-=, *=, &*=, /=, //=, %=, |=, &=,^=,**=,<<=,>>=, ||=, &&=
Splat *, **
**
has higher precedence than +
and *
why is it in the middle ?