Complex.Zero Field

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a new Complex instance with a real number equal to zero and an imaginary number equal to zero.

Namespace:   System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

public static readonly Complex Zero

Field Value

Type: System.Numerics.Complex

The Zero property is most frequently used to compare a Complex value to zero.

The following example instantiates a Complex value by using the Zero property. It then compares this value to another value that is instantiated by calling the Complex constructor with a real part equal to zero and an imaginary part equal to zero. As the output from the example shows, the two values are equal.

using System;
using System.Numerics;

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

      // Instantiate a complex number with real part 0 and imaginary part 1.
      Complex value1 = new Complex(0, 0);
      Console.WriteLine(value.Equals(value1));
   }
}
// The example displays the following output:
//       (0, 0)
//       True

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone
Available since 8.1
Return to top
Show: