Complex.Zero 字段
定义
public: static initonly System::Numerics::Complex Zero;
public static readonly System.Numerics.Complex Zero;
staticval mutable Zero : System.Numerics.Complex
Public Shared ReadOnly Zero As Complex
字段值
示例
下面的示例 Complex 使用属性将值实例化 Zero 。The following example instantiates a Complex value by using the Zero property. 然后,它会将此值与另一个值进行比较,此值是通过调用 Complex 构造函数,而实部等于零,虚部等于零。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
Imports System.Numerics
Module Example
Public Sub Main()
Dim value As Complex = Complex.Zero
Console.WriteLine(value.ToString())
' Instantiate a complex number with real part 1 and imaginary part 0.
Dim value1 As New Complex(0, 0)
Console.WriteLine(value.Equals(value1))
End Sub
End Module
' The example displays the following output:
' (0, 0)
' True
注解
Zero属性最常用于比较 Complex 值为零。The Zero property is most frequently used to compare a Complex value to zero.