Complex.UnaryNegation(Complex) 运算符

定义

返回指定复数的加法逆元。Returns the additive inverse of a specified complex number.

public:
 static System::Numerics::Complex operator -(System::Numerics::Complex value);
public static System.Numerics.Complex operator - (System.Numerics.Complex value);
static member ( ~- ) : System.Numerics.Complex -> System.Numerics.Complex
Public Shared Operator - (value As Complex) As Complex

参数

value
Complex

要求反的值。The value to negate.

返回

Real 参数的 Imaginaryvalue 部分乘以 -1 的结果。The result of the Real and Imaginary components of the value parameter multiplied by -1.

注解

UnaryNegation 方法定义复数的一元求反(加法反运算)运算符的运算。The UnaryNegation method defines the operation of the unary negation (additive inverse) operator for complex numbers. 它可以实现如下所示的代码:It enables code such as the following:

Complex c1 = new Complex(1.7, 3.9);
Complex c2 = -c1;
Dim c1 As New Complex(1.7, 3.9)
Dim c2 As Complex = -c1

如果生成的复数添加到原始复数,则会产生 Zero 值。The resulting complex number produces a value of Zero when it is added to the original complex number. 不支持自定义运算符的语言可以改为调用 Negate 方法。Languages that do not support custom operators can call the Negate method instead.

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

适用于

另请参阅