Decimal.UnaryNegation(Decimal) 操作员

定义

对指定 Decimal 操作数的值求反。Negates the value of the specified Decimal operand.

public:
 static System::Decimal operator -(System::Decimal d);
public static decimal operator - (decimal d);
static member ( ~- ) : decimal -> decimal
Public Shared Operator - (d As Decimal) As Decimal

参数

d
Decimal

要求反的值。The value to negate.

返回

d 乘以负一 (-1) 的结果。The result of d multiplied by negative one (-1).

注解

UnaryPlus 方法定义 Decimal 值的一元求反运算符(或加法逆运算符)的运算。The UnaryPlus method defines the operation of the unary negation operator (or the additive inverse operator) for Decimal values. 操作将生成一个值,该值将在添加到原始数字时导致为0(零)。The operation produces a value that results in 0 (zero) when it is added to the original number. 不支持自定义运算符的语言可以改为调用 Negate 方法。Languages that do not support custom operators can call the Negate method instead.

此运算符的等效方法是 Decimal.Negate(Decimal)The equivalent method for this operator is Decimal.Negate(Decimal)

适用于

另请参阅