Operators and symbols

Infix operators

This list contains all the infix operators, an example of how the operator would be used, a short explanation, and its precedence. An operator with a higher precedence will be grouped before an operator with less precedence.

OperatorExampleExplanationPrecedence
ina in []Membership operator1
..0..10Range generation2
||true || falseLogic OR3
&&true && falseLogic AND4
>1 > 0"Greater" comparison5
>=1 >= 0"Greater or equal" comparison5
<1 < 0"Less" comparison5
<=1 <= 0"Less or equal" comparison5
/=9 /= 9Negated equality5
='a' = 'a'Equality5
^2 ^ 3Bitwise XOR6
&1 & 0Bitwise AND7
<<1 << 2Left shift8
>>8 >> 2Right shift8
-8 - 3Arithmetic substraction9
+1 + 1Arithmetic addition9
/1 / 2Arithmetic division10
%5 % 7Division remainder10
*5 * 7Arithmetic multiplication10
**2 ** 5Exponentiation11

Prefix operators

This list contains all the prefix operators, an example of how the operator would be used, and a short explanation.

OperatorExampleExplanation
~~1Bitwise negation
!!falseLogic negation
--5Additive inverse