MOD
(value, divisor) ;
The MOD function returns the remainder of the division of elements of the first argument by elements of the second argument.
The arguments to the MOD function are as follows:
is a numeric matrix or literal that contains the dividend.
is a numeric matrix or literal that contains the divisor.
If either operand is a scalar, the MOD function performs the operation for each element of the matrix with the scalar value. If either operand is a row or column vector, then the operation is performed by using that vector on each of the rows or columns of the matrix.
Unlike the MOD function in Base SAS software, the MOD function in SAS/IML software does not perform any numerical “fuzzing” to return an exact zero when the result would otherwise be very small. Thus the results of the SAS/IML MOD function is more similar to the MODZ function in Base SAS software.
An example of a valid statement follows:
c = {-7 14 20 -81 23}; b = mod(c, 4); print b;
Figure 23.192: Remainders after Division
b | ||||
---|---|---|---|---|
-3 | 2 | 0 | -1 | 3 |