共用方式為


Complex.Multiply 方法

定義

將指定的數位乘以另一個指定的數位,其中至少有一個是複數,另一個可能是雙精確度實數。

多載

Multiply(Double, Complex)

傳回雙精確度實數和複數的乘積。

Multiply(Complex, Double)

傳回復數和雙精確度實數的乘積。

Multiply(Complex, Complex)

傳回兩個複數的乘積。

範例

下列範例會依複數陣列中的每個元素,將複數乘以複數。

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex number1 = new Complex(8.3, 17.5);
      Complex[] numbers = { new Complex(1.4, 6.3),
                            new Complex(-2.7, 1.8),
                            new Complex(3.1, -2.1) };
      foreach (Complex number2 in numbers)
         Console.WriteLine("{0} x {1} = {2}", number1, number2,
                           Complex.Multiply(number1, number2));
   }
}
// The example displays the following output:
//       (8.3, 17.5) x (1.4, 6.3) = (-98.63, 76.79)
//       (8.3, 17.5) x (-2.7, 1.8) = (-53.91, -32.31)
//       (8.3, 17.5) x (3.1, -2.1) = (62.48, 36.82)
open System.Numerics

let number1 = Complex(8.3, 17.5)
let numbers = [ Complex(1.4, 6.3); Complex(-2.7, 1.8); Complex(3.1, -2.1) ]

for number2 in numbers do
    printfn $"{number1} x {number2} = {Complex.Multiply(number1, number2)}"
// The example displays the following output:
//       (8.3, 17.5) x (1.4, 6.3) = (-98.63, 76.79)
//       (8.3, 17.5) x (-2.7, 1.8) = (-53.91, -32.31)
//       (8.3, 17.5) x (3.1, -2.1) = (62.48, 36.82)
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim number1 As New Complex(8.3, 17.5)
      Dim numbers() As Complex = { New Complex(1.4, 6.3), 
                                   New Complex(-2.7, 1.8), 
                                   New Complex(3.1, -2.1) }
      For Each number2 In numbers
         Console.WriteLine("{0} x {1} = {2}", number1, number2, 
                           Complex.Multiply(number1, number2))
      Next
   End Sub
End Module
' The example displays the following output:
'       (8.3, 17.5) x (1.4, 6.3) = (-98.63, 76.79)
'       (8.3, 17.5) x (-2.7, 1.8) = (-53.91, -32.31)
'       (8.3, 17.5) x (3.1, -2.1) = (62.48, 36.82)

備註

Multiply 方法允許執行涉及複數的乘法運算。

如果乘法導致實數或虛數位件溢位,該元件的值為 Double.PositiveInfinityDouble.NegativeInfinity

Multiply 方法會針對不支援自定義運算子的語言實作。 其行為與使用乘法運算子的乘法相同。

Multiply(Double, Complex)

來源:
Complex.cs
來源:
Complex.cs
來源:
Complex.cs

傳回雙精確度實數和複數的乘積。

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

參數

left
Double

要相乘的雙精確度實數。

right
Complex

要相乘的複數。

傳回

leftright 參數的乘積。

備註

實數乘法(可視為複數 a + 0i)和複數(c + di)採用下列形式:

$ac + adi$

另請參閱

適用於

Multiply(Complex, Double)

來源:
Complex.cs
來源:
Complex.cs
來源:
Complex.cs

傳回復數和雙精確度實數的乘積。

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

參數

left
Complex

要相乘的複數。

right
Double

要相乘的雙精確度實數。

傳回

leftright 參數的乘積。

備註

複數乘法(a + bi)和實數(可視為複數 c + 0i)採用下列形式:

$ac + bci$

另請參閱

適用於

Multiply(Complex, Complex)

來源:
Complex.cs
來源:
Complex.cs
來源:
Complex.cs

傳回兩個複數的乘積。

public:
 static System::Numerics::Complex Multiply(System::Numerics::Complex left, System::Numerics::Complex right);
public static System.Numerics.Complex Multiply (System.Numerics.Complex left, System.Numerics.Complex right);
static member Multiply : System.Numerics.Complex * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Multiply (left As Complex, right As Complex) As Complex

參數

left
Complex

要相乘的第一個複數。

right
Complex

要相乘的第二個複數。

傳回

leftright 參數的乘積。

備註

複數 a + bi乘法和第二個複數 c + di,採用下列形式:

$(ac - bd) + (ad + bc)i$

另請參閱

適用於