# Function Reference

Mod

Performs the modulus operation.

Mod ( value1, value2 )

Parameters

value1 | The dividend.
value2 | The divisor.

Return Value

Success: | Returns the remainder when value1 is divided by value2.
Failure: | Returns -1.#IND if the divisor is zero.

Remarks

quotient = dividend / divisor
This function works with floats as well as integers.

Related

None.

Example

$n = 18
If mod($n, 2) = 0 Then
MsgBox(0,"", $n & " is an even number.")
Else
MsgBox(0, "", $n & " is an odd number.")
EndIf
$x = mod(4, 7) ;$x == 4 because the divisor > dividend
$y = mod(1, 3/4) ;$y == 0.25 because the divisor is a float