Returns the truncated remainder of x divided by y.
MOD(x,y)
x and y are arithmetic values.
MOD(15,2) /* returns 1 */
The value of y must not be 0.
An MOD operation on floating-point decimal data is actually performed using the floating-point binary operation. Thus, the range of the operands and the result of the operation are limited to the ranges for floating-point binary numbers.
Description
The MOD function returns the truncated remainder of x divided by y. The result is x-y*FLOOR(x/y) and has the common data type of x and y.
To determine the precision of the result, let (px,qx) and (py,qy) represent the precision of x and y, respectively. If the common type of x and y is fixed point, the precision of the result is:
Otherwise, the precision of the result is MAX(px,py). n is the maximum precision allowed for the common type of x and y. For details on maximum precisions, see your Open PL/I User's Guide.