Skip to main content

Operators

Listed from lowest to highest precedence, matching how the parser descends through expressions.

LevelOperatorsAssociativity
Logical ORorLeft, short-circuits
Logical ANDandLeft, short-circuits
Equality== !=Left
Comparison< <= > >=Left
Term+ -Left
Factor* / %Left
Unarynot -Right, prefix

+ concatenates when either operand is a string; otherwise both operands must be integers. Comparison operators require both operands to be integers. Division and modulo by zero raise runtime errors rather than returning infinity or NaN. Logical and/or require boolean operands on both sides — TLang does not treat integers or strings as truthy.