Subtract one complex number from another and returns the result in CSharp
Description
The following code shows how to subtract one complex number from another and returns the result.
Example
using System;/*from w w w. jav a2 s .c o m*/
using System.Numerics;
public class Example
{
public static void Main()
{
Complex c1 = new Complex(4.3, 6.6);
Complex[] values = { new Complex(12.5, 9.6), new Complex(-5.3, -6.6) };
foreach (var c2 in values)
Console.WriteLine("{0} - {1} = {2}", c1, c2,
Complex.Subtract(c1, c2));
}
}
The code above generates the following result.