Used to find the difference between two numbers or to indicate the negative value of a numeric expression.
result = number1-number2
-number
The - operator syntax has these parts:
Part | Description |
result | Any numeric variable. |
number | Any numeric expression. |
number1 | Any numeric expression. |
number2 | Any numeric expression. |
In Syntax 1, the - operator is the arithmetic subtraction operator used to find the difference between two numbers. In Syntax 2, the - operator is used as the unary negation operator to indicate the negative value of an expression.
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, Integer, Long, Single, Double, Currency. The following are exceptions to this order:
Note The order of precision used by addition and subtraction is not the same as the order of precision used by multiplication.
If one or both expressions are Null expressions, result is Null. If an expression is Empty, it is treated as if it were 0.
Operator Precedence.
This example uses the - operator to calculate the difference between two numbers.
MyResult = 4 - 2 ' Returns 2.= 459.35 - 334.90 ' Returns 124.45.