Skip to main content

Operators

Arithmetic

NameExample
Multiplicationa * b
Divisiona / b
Modulusa % b
Additiona + b
Subtractiona - b

Assignment

NameExample
Assignmenta = b
Multiplicationa *= b
Divisiona /= b
Modulusa %= b
Additiona += b
Subtractiona -= b

Relational

OperatorMeaningExample
==Equalsfoo == 32
!=Not equalsfoo != 32
>Greater thanfoo > 32
>=Greater than or equalsfoo >= 32
<Less thanfoo < 32
<=Less than or equalsfoo <= 32
&&Logical ANDfoo && bar
||Logical ORfoo || bar

Types

NameExample
Type castfoo as bar
Type equalityfoo is bar
Type retrievaltypeof(foo)

Primary

NameExample
Memberfoo.bar
Static memberfoo::bar
Function callfoo(bar)
Static function callfoo::bar(qux)

Unary

NameExample
Logical NOT!foo
Negative-5
Positive+5
Grouping(foo + bar)