Syntax |
Expression1 Mod expression2 |
Description |
Returns the remainder of expression1 / expression2 as a whole number. |
Comments |
If both expressions are integers, then the result is an integer. Otherwise, each expression is converted to a Long before performing the operation, returning a Long. A runtime error occurs if the result overflows the range of a Long. If either expression is Null, then Null is returned. Empty is treated as 0. |
Example |
This example uses the Mod operator to determine the value of a randomly selected card where card 1 is the ace (1) of clubs and card 52 is the king (13) of spades. Since the values recur in a sequence of 13 cards within 4 suits, we can use the Mod function to determine the value of any given card number. Const crlf = Chr$(13) + Chr$(10) Sub Main() |
See Also |
M |