Complex.Pow 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回指定复数的指定次幂。
重载
Pow(Complex, Double) |
返回指定复数的由双精度浮点数指定的次幂。 |
Pow(Complex, Complex) |
返回指定复数的由复数指定的次幂。 |
Pow(Complex, Double)
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
返回指定复数的由双精度浮点数指定的次幂。
public:
static System::Numerics::Complex Pow(System::Numerics::Complex value, double power);
public static System.Numerics.Complex Pow (System.Numerics.Complex value, double power);
static member Pow : System.Numerics.Complex * double -> System.Numerics.Complex
Public Shared Function Pow (value As Complex, power As Double) As Complex
参数
- value
- Complex
要对其求幂的复数。
- power
- Double
指定幂的双精度浮点数。
返回
复数 value
的 power
次幂。
示例
以下示例演示了使用复数和其值范围为 -1 到 10 的指数的指数。
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
Complex value = new Complex(12, -6);
for (int power = -1; power <= 10; power++)
Console.WriteLine("{0} ^ {1,2} = {2:N2}", value, power,
Complex.Pow(value, power));
}
}
// The example displays the following output:
// (12, -6) ^ -1 = (0.07, 0.03)
// (12, -6) ^ 0 = (1.00, 0.00)
// (12, -6) ^ 1 = (12.00, -6.00)
// (12, -6) ^ 2 = (108.00, -144.00)
// (12, -6) ^ 3 = (432.00, -2,376.00)
// (12, -6) ^ 4 = (-9,072.00, -31,104.00)
// (12, -6) ^ 5 = (-295,488.00, -318,816.00)
// (12, -6) ^ 6 = (-5,458,752.00, -2,052,864.00)
// (12, -6) ^ 7 = (-77,822,208.00, 8,118,144.00)
// (12, -6) ^ 8 = (-885,157,632.00, 564,350,976.00)
// (12, -6) ^ 9 = (-7,235,785,728.00, 12,083,157,504.00)
// (12, -6) ^ 10 = (-14,330,483,712.00, 188,412,604,416.00)
open System.Numerics
let value = Complex(12.0, -6.0)
for power in -1. .. 10. do
printfn $"{value} ^ {power, 2} = {Complex.Pow(value, power):N2}"
// The example displays the following output:
// (12, -6) ^ -1 = (0.07, 0.03)
// (12, -6) ^ 0 = (1.00, 0.00)
// (12, -6) ^ 1 = (12.00, -6.00)
// (12, -6) ^ 2 = (108.00, -144.00)
// (12, -6) ^ 3 = (432.00, -2,376.00)
// (12, -6) ^ 4 = (-9,072.00, -31,104.00)
// (12, -6) ^ 5 = (-295,488.00, -318,816.00)
// (12, -6) ^ 6 = (-5,458,752.00, -2,052,864.00)
// (12, -6) ^ 7 = (-77,822,208.00, 8,118,144.00)
// (12, -6) ^ 8 = (-885,157,632.00, 564,350,976.00)
// (12, -6) ^ 9 = (-7,235,785,728.00, 12,083,157,504.00)
// (12, -6) ^ 10 = (-14,330,483,712.00, 188,412,604,416.00)
Imports System.Numerics
Module Example
Public Sub Main()
Dim value As New Complex(12, -6)
For power As Integer = -1 To 10
Console.WriteLine("{0} ^ {1,2} = {2:N2}", value, power,
Complex.Pow(value, power))
Next
End Sub
End Module
' The example displays the following output:
' (12, -6) ^ -1 = (0.07, 0.03)
' (12, -6) ^ 0 = (1.00, 0.00)
' (12, -6) ^ 1 = (12.00, -6.00)
' (12, -6) ^ 2 = (108.00, -144.00)
' (12, -6) ^ 3 = (432.00, -2,376.00)
' (12, -6) ^ 4 = (-9,072.00, -31,104.00)
' (12, -6) ^ 5 = (-295,488.00, -318,816.00)
' (12, -6) ^ 6 = (-5,458,752.00, -2,052,864.00)
' (12, -6) ^ 7 = (-77,822,208.00, 8,118,144.00)
' (12, -6) ^ 8 = (-885,157,632.00, 564,350,976.00)
' (12, -6) ^ 9 = (-7,235,785,728.00, 12,083,157,504.00)
' (12, -6) ^ 10 = (-14,330,483,712.00, 188,412,604,416.00)
注解
如果 value
为 Complex.Zero,则此方法返回 Complex.Zero。 对于其他值,如果 power
为 0,则该方法返回 Complex.One;如果 power
为 1,则返回 value
。
此方法对应于 Math.Pow 基元数值类型的 方法。
适用于
Pow(Complex, Complex)
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
返回指定复数的由复数指定的次幂。
public:
static System::Numerics::Complex Pow(System::Numerics::Complex value, System::Numerics::Complex power);
public static System.Numerics.Complex Pow (System.Numerics.Complex value, System.Numerics.Complex power);
static member Pow : System.Numerics.Complex * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Pow (value As Complex, power As Complex) As Complex
参数
- value
- Complex
要对其求幂的复数。
- power
- Complex
指定幂的复数。
返回
复数 value
的 power
次幂。