Mega Code Archive

 
Categories / C# / Data Types
 

Subtracts one complex number from another and returns the result

using System; 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));    } }