Skip to main content
Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Entries: 22

- (operator)

Definition Subtraction or unary minus. Applicable to numerical expressions. Syntax
Example

-= (operator)

Definition Subtract assignment. Replaces the variable with its current value minus the right-hand expression. Applicable to int and float combinations using the same rules as -. Syntax
Example

:= (operator)

Definition Reassignment operator. It is used to assign a new value to a previously declared variable. Syntax
Example

! (operator)

Definition Logical NOT. Applicable to boolean expressions: !x is true when x is false, and false when x is true. It is the symbol spelling of not, and the two are the same token to the lexer. Syntax
Example

!= (operator)

Definition Not equal to. Applicable to expressions of any type. True when its two operands differ. Syntax
Example

? (operator)

Definition Ternary conditional operator. Syntax
Example

* (operator)

Definition Multiplication. Applicable to numerical expressions. Syntax
Example

*= (operator)

Definition Multiply assignment. Replaces the variable with the product of its current value and the right-hand expression. Applicable to int and float combinations using the same rules as *. Syntax
Example

/ (operator)

Definition Division. Applicable to numerical expressions. Syntax
Notes
  • The result is always a float, so int h = 4 / 2 is rejected. Use math.floor, math.round or math.ceil to get an int.
Example

/= (operator)

Definition Divide assignment. Replaces the variable with its current value divided by the right-hand expression. The result is always a float, so the variable must already be a float (or the assignment is rejected). Syntax
Example

&& (operator)

Definition Logical AND. Applicable to boolean expressions. Syntax
Example

% (operator)

Definition Modulo: the remainder of dividing the left operand by the right one. Applicable to numerical expressions, ints and floats. The result is an int when both operands are ints, and a float when either is a float (so int x = 7.5 % 2 is rejected: use math.floor, math.round or math.ceil). A string operand is rejected. The result has the sign of the left operand: -7 % 3 is -1, 7 % -3 is 1 and -7.5 % 2 is -1.5. Syntax
Example

%= (operator)

Definition Modulo assignment. Replaces the variable with the remainder of dividing its current value by the right-hand expression. The result follows %: a float variable accepts an int or a float operand; an int variable accepts only an int operand, and a float operand is an error that suggests math.floor, math.round or math.ceil. A string variable is rejected. Syntax
Example

+ (operator)

Definition Addition. Applicable to numerical expressions or strings. A unary plus (+x) is accepted. Syntax
Example

+= (operator)

Definition Add assignment. Replaces the variable with the sum of its current value and the right-hand expression. Works on numbers and on two strings. The left-hand side may be a dotted field on an object (for example point.x += 1) as well as a plain variable. The variable must already exist. Syntax
Example

< (operator)

Definition Less than. Applicable to numerical expressions. Syntax
Example

<= (operator)

Definition Less than or equal to. Applicable to numerical expressions. Syntax
Example

= (operator)

Definition for assignment. Syntax
Example

== (operator)

Definition Equal to. Applicable to expressions of any type. Syntax
Example

> (operator)

Definition Greater than. Applicable to numerical expressions. Syntax
Example

>= (operator)

Definition Greater than or equal to. Applicable to numerical expressions. Syntax
Example

|| (operator)

Definition It evaluates two Boolean expressions and returns true if at least one of them is true. Syntax
Example