Divides a numeric variable by a numeric expression.
Div x, y( command)
% = i Div j)( operator)
% = Div(i, j)( function)
x:numeric variable
y:any numeric expression
i, j:integer expression
Div x, y divides the expression y into the value in variable x. It depends on the type of the variable x which whether the division is an integer or a floating-point division.
The operator i Div j and function Div(i, j, …) return an integer value. In case one of the parameters isn't an integer, it is converted to a 32-bit values first (using CInt).
Debug.Show
Dim b# = 7.5
Trace b# Div 3 // CInt(b#) \ 3 = 2
Trace Div(b#, 3) // CInt(b#) \ 3 = 2
Div b#, 3 : Trace b# // b# = 2.5
b# = 8.5
Trace b# Div 3 // CInt(b#) \ 3 = 2
Trace Div(b#, 3) // CInt(b#) \ 3 = 2
Div b#, 3 : Trace b# // b# = 2.833333333333
The following can be used instead of Div x, y:
x = x / y
x := x / y
x /= y
+, -, *, /, \, Add, Sub, Mul, Div, ++, --, +=, -=, /= , *=, Operator Hierarchy
{Created by Sjouke Hamstra; Last updated: 24/06/2017 by James Gaite}