Divide and multiply Complex values in CSharp
Description
The following code shows how to divide and multiply Complex values.
Example
/*w w w. j ava 2s. co m*/
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
Complex c1 = new Complex(Double.MaxValue / 2, Double.MaxValue /2);
Complex c2 = c1 / Complex.Zero;
Console.WriteLine(c2.ToString());
c2 = c2 * new Complex(1.5, 1.5);
Console.WriteLine(c2.ToString());
Console.WriteLine();
Complex c3 = c1 * new Complex(2.5, 3.5);
Console.WriteLine(c3.ToString());
c3 = c3 + new Complex(Double.MinValue / 2, Double.MaxValue / 2);
Console.WriteLine(c3);
}
}
The code above generates the following result.