/ Operator
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

/ Operator

Divides two numbers and returns a floating-point result.

number1 / number2


Required. Any numeric variable.
Required. Any numeric expression.
Required. Any numeric expression.


The result is the quotient of number1 divided by number2.

Supported Types

Byte, Short, Integer, Long, Single, Double, Decimal


The data type of result is usually Double. The following are exceptions to this rule:

If Then result is
One expression is Single and the other is any data type except Double Single.
Both expressions are Decimal data types Decimal. If a Decimal expression is divided by 0, a DividebyZero exception is raised. This exception only occurs with a Decimal expression.

If an expression is stated as Nothing, or is Empty, it is treated as zero.


This example uses the / operator to perform floating-point division. The result is the quotient of the two operands.

Dim MyValue As Double
MyValue = 10 / 4   ' Returns 2.5.
MyValue = 10 / 3   ' Returns 3.333333.

See Also

\= Operator | \ Operator | Arithmetic Operators | Operator Precedence in Visual Basic | Operators Listed by Functionality | Arithmetic Operators

© 2015 Microsoft