Поделиться через


Mod Operator

Divides two integers and returns the integer remainder.

result = number1 Mod number2

Arguments

  • Result
    Any numeric variable.

  • number1
    Any numeric expression.

  • number2
    Any numeric expression.

Remarks

If number1 or number2 are floating point numbers, they are first rounded to integers.

The Mod (modulus) operator divides number1 by number2 and returns the integer remainder.

For example, in the following expression, A equals 5.

A = 19 Mod 7

If any expression is Null, result is also Null. Any expression that is Empty is treated as 0.

Requirements

Version 1

See Also

Reference

Arithmetic Operators

Operator Precedence (VBScript)

Other Resources

Operator Summary (VBScript)

Change History

Date

History

Reason

August 2009

Modified example and explanation of example.

Customer feedback.