Complex.Subtraction 操作员

定义

从另一个指定数字中减去指定数字,其中至少有一个是复数,另一个数字可能是双精度实数。

重载

Subtraction(Double, Complex)

从双精度实数中减去复数。

Subtraction(Complex, Double)

从复数中减去双精度实数。

Subtraction(Complex, Complex)

从另一个复数中减去复数。

注解

Subtraction 运算符允许执行涉及复数的减法运算。 它启用以下代码:

System.Numerics.Complex c1 = new System.Numerics.Complex(6.7, -1.3);
System.Numerics.Complex c2 = new System.Numerics.Complex(1.4, 3.8);
System.Numerics.Complex result = c1 - c2;
Console.WriteLine("{0} - {1} = {2}", c1, c2, result);
// The example displays the following output:
//       (6.7, -1.3); - (1.4, 3.8); = (5.3, -5.1)
let c1 = System.Numerics.Complex(6.7, -1.3)
let c2 = System.Numerics.Complex(1.4, 3.8)
let result = c1 - c2
printfn $"{c1}; - {c2}; = {result}"
// The example displays the following output:
//       (6.7, -1.3); - (1.4, 3.8); = (5.3, -5.1)
Dim c1 As New System.Numerics.Complex(6.7, -1.3)
Dim c2 As New System.Numerics.Complex(1.4, 3.8)
Dim result As System.Numerics.Complex = c1 - c2
Console.WriteLine("{0} - {1} = {2}", c1, c2, result)
' The example displays the following output:
'       (6.7, -1.3) - (1.4, 3.8) = (5.3, -5.1)

如果减法导致实际或虚分量溢出,则该分量的值是 Double.PositiveInfinityDouble.NegativeInfinity

不支持自定义运算符的语言可以改为调用 Subtract 等效的方法组。

接收一双双的 Addition 运算符比接收两个复数的运算符更有效。

Subtraction(Double, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

从双精度实数中减去复数。

public:
 static System::Numerics::Complex operator -(double left, System::Numerics::Complex right);
public static System.Numerics.Complex operator - (double left, System.Numerics.Complex right);
static member ( - ) : double * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Operator - (left As Double, right As Complex) As Complex

参数

left
Double

要从 (minuend) 中减去的双精度实值。

right
Complex

要减去的复杂值(减法)。

返回

right 减去 left作为复数的结果。

注解

从实数(可视为复数 a + 0i)中减去复数(c + di)采用以下形式:

$(a - c) - di$

不支持自定义运算符的语言可以改为调用 Complex.Subtract(Double, Complex) 方法。

另请参阅

适用于

Subtraction(Complex, Double)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

从复数中减去双精度实数。

public:
 static System::Numerics::Complex operator -(System::Numerics::Complex left, double right);
public static System.Numerics.Complex operator - (System.Numerics.Complex left, double right);
static member ( - ) : System.Numerics.Complex * double -> System.Numerics.Complex
Public Shared Operator - (left As Complex, right As Double) As Complex

参数

left
Complex

要从 (minuend) 中减去的复杂值。

right
Double

要减去的双精度实值(减法)。

返回

right 减去 left作为复数的结果。

注解

从复数(a + bi)中减法(可视为复数 c + 0i)采用以下形式:

$(a - c) + bi$

不支持自定义运算符的语言可以改为调用 Complex.Subtract(Complex, Double) 方法。

另请参阅

适用于

Subtraction(Complex, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

从另一个复数中减去复数。

public:
 static System::Numerics::Complex operator -(System::Numerics::Complex left, System::Numerics::Complex right);
public:
 static System::Numerics::Complex operator -(System::Numerics::Complex left, System::Numerics::Complex right) = System::Numerics::ISubtractionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>::op_Subtraction;
public static System.Numerics.Complex operator - (System.Numerics.Complex left, System.Numerics.Complex right);
static member ( - ) : System.Numerics.Complex * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Operator - (left As Complex, right As Complex) As Complex

参数

left
Complex

要从中减去的值(minuend)。

right
Complex

要减去的值(减法)。

返回

left中减去 right 的结果。

实现

注解

复数(c + di)从另一个复数 a + bi减法采用以下形式:

$(a - c) + (b - d)i$

不支持自定义运算符的语言可以改为调用 Complex.Subtract(Complex, Complex) 方法。

另请参阅

适用于