\ (operator)


expression1 \ expression2


Returns the integer division of expression1 and expression2.


Before the integer division is performed, each expression is converted to the data type of the most precise expression. If the type of the expressions is either Single, Double, Date, or Currency, then each is rounded to Long.

If either expression is a Variant, then the following additional rules apply:

If either expression is Null, then the result is Null.

Empty is treated as an Integer of value 0.


This example assigns the quotient of two literals to a variable and displays the result.

Sub Main()
  s% = 100.99 \ 2.6
  MsgBox "Integer division of 100.99\2.6 is: " & s%
End Sub

See Also

/ (operator); Operator Precedence (Topic)

More information