MOD

The MOD operator calculates the modulus.

Syntax

int-expr MOD int-expr
  1. int-expr is an integer expression.

Usage

The MOD operator returns the remainder, as an integer, from the division of the integer part of two numbers.

If the right operand is a number with a decimal part, it is rounded to a whole integer before computing the modulus.

MAIN
  DISPLAY 256 MOD 16
  DISPLAY 26 MOD 2
  DISPLAY 27 MOD 2
END MAIN