| System Functions |
|
| Formats | MOD(num,base[,ERR=stmtref]) Where: |
|
| 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. | |
| Returns | Numeric, modulus / remainder. | |
| Description | The MOD( ) function returns the modulus / remainder from a division of the first expression by the second. | |
| *Note* | You can also use the pipe | operator to return a modulus value. The syntax is as follows: num|base,ERR=stmtref. | |
| Examples | 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: 1040 IFMOD(Y,4)=0THENLET N.MAX=366,M.TBL$(3,2)="29"ELSE LET N.MAX=365, 1040:M.TBL$(3,2)="28" Use of the pipe "|" is the equivalent of the syntax in line 1040 above: 1040 IF Y|4=0 THEN LET N.MAX=366,M.TBL$(3,2)="29" ELSE LET N.MAX=365, 1040:M.TBL$(3,2)="28" |
|