ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods






OPERATOR:  Mod

 Mod

The Mod operator divides two numbers and returns the remainder.

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

Code:
<% remainder = 26 Mod 5 %>

Output:
1

Note that for floating-point numbers, the numbers to the right of the decimal are simply ignored (i.e., in the example, 5.7176 is treated as 5 by Mod).

Code:
<% remainder = 26.1234 Mod 5.7176 %>

Output:
1