Divides two numbers and returns a floating-point result.
number1 / number2
The result is the quotient of number1 divided by number2.
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.
\= Operator | \ Operator | Arithmetic Operators | Operator Precedence in Visual Basic | Operators Listed by Functionality |