MOD( ) |
Return Modulus |
MOD(num,base[,ERR=stmtref])
base |
Modulus base value. Numeric expression. |
num |
Value for which to calculate the modulus. Numeric expression. |
stmtref |
Program line number or statement label to which to transfer control. |
Numeric, modulus/remainder.
The MOD( ) function returns the modulus/remainder from a division of the first expression by the second.
A=mod(10,3) ! yields A=1
A=mod(10,5) ! yields A=0
A=mod(9,3.5) ! yields A=2
The following conditions deal with leap year dates:
if mod(Y,4)=0 \
then N.MAX=366,M.TBL$(3,2)="29" \
else N.MAX=365,M.TBL$(3,2)="28"
Use of the | (pipe operator) is the equivalent of the syntax above:
if Y|4=0 \
then N.MAX=366,M.TBL$(3,2)="29" \
else N.MAX=365,M.TBL$(3,2)="28"