Create a new Complex number with a real number equal to zero and an imaginary number equal to one in CSharp

Description

The following code shows how to create a new Complex number with a real number equal to zero and an imaginary number equal to one.

Example


using System;/*from w w  w .  j  av  a 2  s  .  c  o m*/
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex value = Complex.ImaginaryOne;
      Console.WriteLine(value.ToString());

      Complex value1 = new Complex(0, 1);
      Console.WriteLine(value.Equals(value1));
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var