\ Operator

Description

Used to divide two numbers and return an integer result.

Syntax

result = number1\number2

The \ operator syntax has these parts:

Part

Description

result

Any numeric variable.

number1

Any numeric expression.

number2

Any numeric expression.


Remarks

Before division is performed, the numeric expressions are rounded to Integer or Long expressions.

Usually, the data type of result is an Integer, Integer variant, Long, or Long variant, regardless of whether or not result is a whole number. Any fractional portion is truncated. However, if any expression is a Null, result is also a Null. Any expression that is Empty is treated as 0.

See Also

Operator Precedence.

Example

This example uses the \ operator to perform integer division.


MyValue = 11 \ 4    ' Returns 2.
MyValue = 9 \ 3    ' Returns 3. 
MyValue = 100 \ 3    ' Returns 33.