/ Operator

Description

Used to divide two numbers and return a floating-point 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

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

  • When both expressions are Byte, Integer, or Single expressions, result is a Single unless it overflows its legal range; in which case, an error occurs.
  • When both expressions are Byte, Integer, or Single variants, result is a Single variant unless it overflows its legal range; in which case, result is a Variant containing a Double.

If one or both expressions are Null expressions, result is Null. Any expression that is Empty is treated as 0.

See Also

Operator Precedence.

Example

This example uses the / operator to perform floating-point division.


MyValue = 10 / 4            ' Returns 2.5.= 10 / 3            ' Returns 3.333333.