SyntaxDim result As type = number1 Mod number2
DescriptionThe Mod operator returns the modulus, that is, the remainder when number1 is divided by number2. This return value is a nonnegative integral data type. Usage at a Glance
ExampleMsgBox(10 Mod 3) ' returns 1 Version DifferencesThe Mod operator can be overloaded beginning in the 2005 edition of Visual Basic. The custom overload can assign any logic or restrictions on its use. See AlsoIEEERemainder Function |