Previous Topic: $RECSEGMENT FunctionNext Topic: $RETURNCODE Function


$REMAINDER Function

$REMAINDER returns the remainder after one numeric expression is divided by another. Mathematically, the remainder is defined as

m ‑ ([m|n] * n)

where [ ] means “the integer portion of.”

This function has the following format:

$REMAINDER(m,DIV=n)
m

The dividend. This must be a numeric expression.

DIV=n

The divisor. This must be a numeric expression.

Examples

SET I = 100
    SET J = 2567
    SET K = $REMAINDER (J,DIV=I) : remainder is 67
SET I = 100
    SET J = ‑2567
    SET K = $REMAINDER (J,DIV=I) : remainder is ‑67