Skip to content
This repository was archived by the owner on Oct 4, 2026. It is now read-only.

Operators

las_r edited this page May 11, 2025 · 9 revisions

Operators are used in many programming languages, including Pupil. They serve many different functions, ranging from arithmetic operations to boolean comparisons.

Note that all operators are calculated left to right in Pupil.

List of operators

Arithmetic

x + y - Add
x - y - Subtract
x * y - Multiply
x / y - Divide
x ^ y - Exponentiate
x % y - Modulus

Bitwise

x & y - Bitwise AND
x | y - Bitwise OR
x : y - Bitwise XOR\

Boolean / Comparison

x == y - Is equal to
x != y - Is not equal to
x > y - Is greater than
x < y - Is less than
x >= y or x => y - Is greater than or equal to
x <= y or x =< y - Is less than or equal to
x && y - Boolean AND
x || y - Boolean OR
x :: y - Boolean XOR
x !! - Boolean NOT

Assignment

set x = y - Set x to y set x A= y - Set x to x A y (A represents any non-comparison operator)

Misc.

x .. y - String concatenation

Clone this wiki locally