< Day Day Up > |
Mod()Category: Number Syntax: Mod ( number ; divisor ) Parameters: number ”any expression that resolves to a numeric value; divisor ”any expression that resolves to a numeric value. Description: Returns the remainder after number is divided by divisor . Examples: Mod (7 ; 5) Returns 2 . Mod (-7 ; 5) Returns 3 . Mod (13 ; 3) Returns 1 . Mod (1.43 ; 1) Returns .43 . Comments: Mod() is related to the Div() function; Div() returns the whole number portion of x divided by y , whereas Mod() returns the remainder. There are many practical uses for the Mod() function. For instance, when x is an integer, Mod (x ; 2) returns 0 if x is even, and 1 if x is odd. Mod (x ; 1) returns just the decimal portion of a number. |
< Day Day Up > |