operators

Number Operators

NamecuminExampleMath
Addition+x + y\( x+y \)
Subtract-x - y\( x-y \)
Minus--x\( -x \)
Multiply*x * y\( xy \)
Division/x / y\( x/y \)
Modulo%x % y\( x \bmod y \)
Power**x ** y\( x^y \)
Priority()(x + y) * z\( (x+y)\times z \)

There are three types for Numbers: Nat, Int and Float. The operations do implicit type casting. For example, the result of Nat + Float has Float. It is one-way Nat -> Int -> Float.

Bool Operators

NamecuminExampleMath
Andandx and y\( a \land b \)
Ororx or y\( a \lor b \)
Xorxorx xor y\( a \oplus b \)
Notnotnot x\( \lnot a \)

Equality

NamecuminExampleMath
Equal==1 == 2 [1,2] == [1,2]\( x = y \)
Inequal!=1 != 2 [1,2] != [1,2]\( x \ne y \)

All objects containing your custom struct values can be compared with == and !=.

Orderity of Numbers

NamecuminExampleMath
LessThan<x < y\( x < y \)
LessEqual<=x <= y\( x \leq y \)
GreaterThan>x > y\( x > y \)
GreaterEqual>=x >= y\( x \geq y \)

Only numbers can be compared.

Array Operators

NamecuminExampleMath
Concat++[1] ++ [2, 3]