Number operators

Highest precedence

(expression) parentheses
variable++
++variable
variable--
--variable
increment the variable after using its value
increment the variable and then use its new value
decrement the variable after using its value
decrement the variable and then use its new value
value ** value exponentiation
!value
~value
-value
+value
logical (Boolean) NOT
bitwise NOT (one's complement)
unary minus (arithmetic negation)
unary plus
value * value
value / value
value % value
multiplication
division
modulus (the remainder from a division)
value + value
value - value
addition
subtraction
value << count
value >> count
shift the value left by the number of bits in count
shift the value right by the number of bits in count
value < value
value > value
value <= value
value >= value
less than (returns true or false)
greater than (returns true or false)
less than or equal (returns true or false)
greater than or equal (returns true or false)
value == value
value != value
value <=> value
equal (returns true or false)
not equal (returns true or false)
comparison (returns -1, 0, +1)
value & value bitwise AND
value | value
value ^ value
bitwise OR
bitwise XOR
value && value logical (Boolean) AND
value || value logical (Boolean) OR
exprA ? exprB : exprC if exprA is true, then evaluate exprB and return its value, else evaluate exprC and return its value
variable = expression
variable op= expression
assign the value of the expression to the variable, and return that value
equivalent to variable = variable op expression, where op is one of * / % + - << >> & ^ |
exprA, exprB evaluate exprA, then evaluate exprB and return its value
not value logical (Boolean) NOT
value and value logical (Boolean) AND
value or value
value xor value
logical (Boolean) OR
logical (Boolean) XOR

Lowest precedence