Calculate the log on a complex number in CSharp
Description
The following code shows how to calculate the log on a complex number.
Example
using System;//ww w . j a v a2 s. c o m
using System.Numerics;
public class Example
{
public static void Main()
{
Complex[] values = { new Complex(1.11, 9.99),
new Complex(Double.MinValue/2, Double.MinValue/2) };
foreach (Complex value in values)
Console.WriteLine("Exp(Log({0}) = {1}", value,
Complex.Exp(Complex.Log(value)));
}
}
The code above generates the following result.