VBScript » Operators » Mod

Version: 1.0

The Mod operator divides two numbers and returns the remainder.

Examples

Code:
<% remainder = 26 Mod 5 %>
Output:
1
Explanation:

In this example, 5 divides into 26, 5 times, with a remainder of 1.

Language(s): VBScript
Code:
<% remainder = 26.1234 Mod 5.7176%>
Output:
2
Explanation:

Note that for floating-point numbers, the numbers to the right of the decimal are rounded to the nearest integer (i.e., in this example, 5.7176 is treated as 6 by Mod).

Language(s): VBScript