The data type of result is usually the same as that of the most precise expression. The order of precision, from least to most precise, is Byte, Short, Integer, Long, Single, Double, and Decimal. The following are exceptions to this order:
If | Then result is |
---|---|
Multiplication involves a Single and a Long, | converted to a Double. |
The data type of result is a Longor Single that overflows its legal range, | A Run-time error will occur. |
The data type of result is a Byte object that overflows its legal range, | A Run-time error will occur. |
the data type of result is an Integer object that overflows its legal range, | A Run-time error will occur. |
If one or both expressions arestated as Nothing, A Variable Not Set
error occurs. If an expression is Empty, it is treated as 0.
Note The order of precision used by multiplication is not the same as the order of precision used by addition and subtraction.
*= Operator | Arithmetic Operators | Operator Precedence in Visual Basic | Operator Summary