Intrinsic-2 Rem

Top  Previous  Next

2: variable:= Rem(expression);

 

This intrinsic is used with integer division. It returns the value of the remainder of the division in the argument expression. If a zero argument argument is used, the intrinsic returns the remainder of the last division performed. For example:

 

       X:= Rem(7/3);           \X gets 1

       Y:= Rem(0);             \Y gets 1

       Z:= Rem(-18/-5);        \Z gets -3