C# Complex Equality

Description

Complex Equality Returns a value that indicates whether two complex numbers are equal.

Syntax

Complex.Equality has the following syntax.


public static bool operator ==(
  Complex left,
  Complex right
)

Parameters

Complex.Equality has the following parameters.

  • left - The first complex number to compare.
  • right - The second complex number to compare.

Returns

Complex.Equality method returns true if the left and right parameters have the same value; otherwise, false.

Example


/*from w w w .  j av  a  2  s.  c  o  m*/

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
        Complex c1 = new Complex(12.6, 4.3);
        Complex c2 = new Complex(11.1, 8.9);
        Console.WriteLine(c1 == c2);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex