Operators

OpenTuring

Operators

Mathematical Operators

OperatorOperationResult Type
Prefix +IdentityAs Operands
Prefix -NegativeAs Operands
+AdditionAs Operands
-SubtractionAs Operands
*MultiplicationAs Operands
/DivisionAs Operands
divInteger Divisionint
modModuloint
remRemainderint
**ExponentiationAs Operands
<Less Thanboolean
>Greater Thanboolean
=Equalsboolean
<=Less Than or Equalboolean
>=Greater Than or Equalboolean
not=Not Equalboolean

Boolean Operators

OperatorOperationResult Type
Prefix notNegationboolean
andAndboolean
orOrboolean
xorExclusive Orboolean
=>Implicationboolean

Set Operators

OperatorOperationResult Type
+Unionset
-Set Subtractionset
*Intersectionset
=Equalityboolean
not=Inequalityboolean
<=Subsetboolean
<Strict (Proper) Subsetboolean
>=Supersetboolean
>Strict (Proper) Supersetboolean

Operators on Members and Sets

OperatorOperationResult Type
inMember of Setboolean
not inNot Member of Setboolean
xorExclusive Orset

Bit Manipulation Operators

OperatorOperationResult Type
shlShift leftnat
shrShift rightnat
andBit-wise Andnat
orBit-wise Ornat
xorBit-wise Exclusive Ornat

Pointer Operators

OperatorOperationResult Type
^Follow pointerTarget type

Type Cheats

OperatorOperationResult Type
#Type cheatnat

Operator Short Forms

These can be used in place of the above notation.
not ~
not= ~=
not in ~in
and &
or |

Operator Precedence

Highest precedence operators first.
  1. **, ^, #
  2. prefix + and -
  3. * , / , div , mod , rem , shl , shr
  4. + , -, xor
  5. < , > , = , <= , >= , not= , in , not in
  6. not
  7. and
  8. or
  9. =>