Visual Basic Language Reference  

/= Operator

Divides the value of a variable by the value of an expression and assigns the result to the variable.

variable /= expression

Parts

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

Remarks

This statement assigns a Double to the variable on the left hand side. If Option Strict is On, variable must be a Double. If Option Strict is Off, an implicit conversion will be made and the resultant value assigned to variable, with a possible error at run time. For more information, see Widening and Narrowing Conversions, and Option Strict Statement.

Example

The following example uses the /= operator to divide one Integer variable by a second and assign the quotient to the first variable.

Dim var1 As Integer = 12
Dim var2 As Integer = 3
var1 /= var2   ' The value of var1 is now 4.

See Also

&= Operator | *= Operator | += Operator | -= Operator | / Operator | = Operator | \= Operator | ^= Operator