Version: 1.1.0

Operator reference

Precedence, from tightest to loosest: calls and subscripts, unary operators, power, multiply and divide, add and subtract, shifts, bitwise and, bitwise xor, bitwise or, comparisons, boolean not, boolean and, boolean or.

Essentials

  • Comparisons are non-associative chains.
  • Assignment operators such as += evaluate the left side once.
  • Boolean operators do not use & and |. Those are bitwise.
  • Unary ~ is bitwise complement, not boolean not.

Example

def main():
    var a = 5
    a += 2
    print(a > 6 and a < 10)

Keep in mind

When two operators look equally tight, add parentheses. Future readers should not need this page open.