The Modulo operator calculates the remainder after dividing one numeric value by another. Mixing Data Types (e.g. Integers and Floats) is not allowed and the Modulo operator does not work on Strings or Booleans.
The short syntax structure uses the % symbol:
PRINT VALUE % VALUEThe long syntax structure uses the word MODULO:
PRINT VALUE MODULO VALUENEW INT x = 10 % 3
PRINT x // Displays "1"NEW FLOAT x = 5.5 % 2.0
PRINT x // Displays "1.5"NEW INT num = 8
PRINT num % 2 // Displays "0"NEW INT counter = 11
SET counter = counter % 10
PRINT counter // Displays "1"NEW INT i = 1
WHILE i <= 10
IF i % 2 == 0
PRINTLN i // Displays even numbers only
END IF
SET i = i + 1
END WHILENEW INT x = 7
NEW FLOAT y = 3.0
PRINT x % y // Type error! Cannot mix Integer and Float Data Types