The negation operators is defined for:
Short
, Integer
and Long
. The result is computed by subtracting the operand from zero. If integer overflow checking in on and the value of the operand is the maximum negative Short
, Integer
or Long
, a System.OverflowException
exception is thrown. Otherwise, if the value of the operand is the maximum negative Short
, Integer
or Long
, the result is that same value and the overflow is not reported.Single
and Double
. The result is the value of the operand with its sign inverted. If the operand is NaN, the result is also NaN.Decimal
. The result is computed by subtracting the operand from zero.-
Expression