# rem

The keyword rem belongs to the family of the arithmetic operators. It operates on two operands of integer type and on its derivates. The operation x rem y computes the rest that remains from an integer division of x by y.

- The result of the operation is integer;
- the operation is defined for non-zero operands only;
- the result is in function of the operands positive or negative, see chapter 15.1 of the standard.

Related keywords:

- mod

### rem

Example:

for (var integer j:=-3; j<=3; j:= j+1) {
var integer vl_log := (j rem 3);
log (vl_log)
}

The log will contain the following integer values: 0 -2 -1 0 1 2 0.

BNF definition of rem