Operator / (Divide)
Divides two numeric expressions
Syntax
`
Declare Operator / ( ByRef lhs As Byte, ByRef rhs As Byte ) As Byte
Declare Operator / ( ByRef lhs As UByte, ByRef rhs As UByte ) As UByte
Declare Operator / ( ByRef lhs As Short, ByRef rhs As Short ) As Short
Declare Operator / ( ByRef lhs As UShort, ByRef rhs As UShort ) As UShort
Declare Operator / ( ByRef lhs As Integer, ByRef rhs As Integer ) As Integer
Declare Operator / ( ByRef lhs As UInteger, ByRef rhs As UInteger ) As UInteger
Declare Operator / ( ByRef lhs As LongInt, ByRef rhs As LongInt ) As LongInt
Declare Operator / ( ByRef lhs As ULongInt, ByRef rhs As ULongInt ) As ULongInt
Declare Operator / ( ByRef lhs As Single, ByRef rhs As Single ) As Single
Declare Operator / ( ByRef lhs As Double, ByRef rhs As Double ) As Double
`
Usage
`
result = lhs` /`rhs
`
Parameters
`lhs`
The left-hand side dividend expression.
`rhs`
The right-hand side divisor expression.
Return Value
Returns the quotient of a dividend and divisor.
Description
`Operator /` (Divide) returns the quotient of a dividend and divisor.
Neither operand is modified in any way. Unlike with integer division, float division by zero is safe to perform, the quotient will hold a special value representing infinity, converting it to a string returns something like "Inf" or "INF", exact text is platform specific.
This operator can be overloaded to accept user-defined types.
Example
`
Dim n As Double
Print n / 5
n = 6 / 2.3
Print n
Sleep
`
Output:

    0
    2.608695652173913

Dialect Differences

- In the -lang qb dialect, this operator cannot be overloaded.

Differences from QB

- None

See also

- Operator \ (Integer Divide)
- Mathematical Functions