C# Complex Subtraction
Description
Complex Subtraction
Subtracts a complex number from
another complex number.
Syntax
Complex.Subtraction
has the following syntax.
public static Complex operator -(
Complex left,
Complex right
)
Parameters
Complex.Subtraction
has the following parameters.
left
- The value to subtract from (the minuend).right
- The value to subtract (the subtrahend).
Returns
Complex.Subtraction
method returns The result of subtracting right from left.
Example
/* ww w. java 2 s. com*/
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
System.Numerics.Complex c1 = new System.Numerics.Complex(6.7, -1.3);
System.Numerics.Complex c2 = new System.Numerics.Complex(1.4, 3.8);
System.Numerics.Complex result = c1 - c2;
Console.WriteLine("{0} - {1} = {2}", c1, c2, result);
}
}
The code above generates the following result.