BigInteger.Equals メソッド

定義

2 つの数値が等しいかどうかを示す値を返します。Returns a value that indicates whether two numeric values are equal.

オーバーロード

Equals(Int64)

現在のインスタンスの値と符号付き 64 ビット整数の値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and a signed 64-bit integer have the same value.

Equals(BigInteger)

現在のインスタンスの値と指定された BigInteger オブジェクトの値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and a specified BigInteger object have the same value.

Equals(Object)

現在のインスタンスの値と指定されたオブジェクトの値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and a specified object have the same value.

Equals(UInt64)

現在のインスタンスの値と符号なし 64 ビット整数の値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and an unsigned 64-bit integer have the same value.

Equals(Int64)

現在のインスタンスの値と符号付き 64 ビット整数の値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and a signed 64-bit integer have the same value.

public:
 bool Equals(long other);
public bool Equals (long other);
override this.Equals : int64 -> bool
Public Function Equals (other As Long) As Boolean

パラメーター

other
Int64

比較する符号付き 64 ビット整数値。The signed 64-bit integer value to compare.

戻り値

Boolean

符号付き 64 ビット整数の値と現在のインスタンスの値が等しい場合は true。それ以外の場合は falsetrue if the signed 64-bit integer and the current instance have the same value; otherwise, false.

次の例では、UInt64を除く各整数型から BigInteger オブジェクトをインスタンス化します。The following example instantiates a BigInteger object from each integral type except UInt64. 次に、Equals(Int64) メソッドを呼び出して、BigInteger の値を BigInteger コンストラクターに渡された元の整数値と比較します。It then calls the Equals(Int64) method to compare the BigInteger value with the original integer value that was passed to the BigInteger constructor. 出力に示されているように、それぞれの値は等しいと見なされます。As the output shows, the values are equal in each case.

#using <System.Numerics.dll>

using namespace System;
using namespace System::Numerics;

void main()
{
   BigInteger bigIntValue;

   Byte byteValue = 16;
   bigIntValue = BigInteger(byteValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      byteValue.GetType()->Name, byteValue,
      bigIntValue.Equals((Int64)byteValue));

   SByte sbyteValue = -16;
   bigIntValue = BigInteger(sbyteValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      sbyteValue.GetType()->Name, sbyteValue,
      bigIntValue.Equals((Int64)sbyteValue));

   Int16 shortValue = 1233;
   bigIntValue = BigInteger(shortValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      shortValue.GetType()->Name, shortValue,
      bigIntValue.Equals((Int64)shortValue));

   UInt16 ushortValue = 64000;
   bigIntValue = BigInteger(ushortValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      ushortValue.GetType()->Name, ushortValue,
      bigIntValue.Equals((Int64)ushortValue));

   int intValue = -1603854;
   bigIntValue = BigInteger(intValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      intValue.GetType()->Name, intValue,
      bigIntValue.Equals((Int64)intValue));

   UInt32 uintValue = 1223300;
   bigIntValue = BigInteger(uintValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      uintValue.GetType()->Name, uintValue,
      bigIntValue.Equals((Int64)uintValue));

   Int64 longValue = -123822229012;
   bigIntValue = BigInteger(longValue);
   Console::WriteLine("{0} {1} = {2} {3} : {4}",
      bigIntValue.GetType()->Name, bigIntValue,
      longValue.GetType()->Name, longValue,
      bigIntValue.Equals((Int64)longValue));
}
/* 
The example displays output like the following:
      BigInteger 16 = Byte 16 : True
      BigInteger -16 = SByte -16 : True
      BigInteger 1233 = Int16 1233 : True
      BigInteger 64000 = UInt16 64000 : True
      BigInteger -1603854 = Int32 -1603854 : True
      BigInteger 1223300 = UInt32 1223300 : True
      BigInteger -123822229012 = Int64 -123822229012 : True
*/
BigInteger bigIntValue;

byte byteValue = 16;
bigIntValue = new BigInteger(byteValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  byteValue.GetType().Name, byteValue,
                  bigIntValue.Equals(byteValue));

sbyte sbyteValue = -16;
bigIntValue = new BigInteger(sbyteValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  sbyteValue.GetType().Name, sbyteValue,
                  bigIntValue.Equals(sbyteValue));

short shortValue = 1233;
bigIntValue = new BigInteger(shortValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  shortValue.GetType().Name, shortValue,
                  bigIntValue.Equals(shortValue));

ushort ushortValue = 64000;
bigIntValue = new BigInteger(ushortValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  ushortValue.GetType().Name, ushortValue,
                  bigIntValue.Equals(ushortValue));

int intValue = -1603854;
bigIntValue = new BigInteger(intValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  intValue.GetType().Name, intValue,
                  bigIntValue.Equals(intValue));

uint uintValue = 1223300;
bigIntValue = new BigInteger(uintValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  uintValue.GetType().Name, uintValue,
                  bigIntValue.Equals(uintValue));

long longValue = -123822229012;
bigIntValue = new BigInteger(longValue);
Console.WriteLine("{0} {1} = {2} {3} : {4}",
                  bigIntValue.GetType().Name, bigIntValue,
                  longValue.GetType().Name, longValue,
                  bigIntValue.Equals(longValue));
// The example displays the following output:
//    BigInteger 16 = Byte 16 : True
//    BigInteger -16 = SByte -16 : True
//    BigInteger 1233 = Int16 1233 : True
//    BigInteger 64000 = UInt16 64000 : True
//    BigInteger -1603854 = Int32 -1603854 : True
//    BigInteger 1223300 = UInt32 1223300 : True
//    BigInteger -123822229012 = Int64 -123822229012 : True
Dim bigIntValue As BigInteger 

Dim byteValue As Byte = 16
bigIntValue = New BigInteger(byteValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  byteValue.GetType().Name, byteValue, 
                  bigIntValue.Equals(byteValue))
                  
Dim sbyteValue As SByte = -16
bigIntValue = New BigInteger(sbyteValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  sbyteValue.GetType().Name, sbyteValue,
                  bigIntValue.Equals(sbyteValue))

Dim shortValue As Short = 1233
bigIntValue = New BigInteger(shortValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  shortValue.GetType().Name, shortValue, 
                  bigIntValue.Equals(shortValue))
      
Dim ushortValue As UShort = 64000
bigIntValue = New BigInteger(ushortValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  ushortValue.GetType().Name, ushortValue, 
                  bigIntValue.Equals(ushortValue))

Dim intValue As Integer = -1603854
bigIntValue = New BigInteger(intValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  intValue.GetType().Name, intValue, 
                  bigIntValue.Equals(intValue))

Dim uintValue As UInteger = 1223300
bigIntValue = New BigInteger(uintValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  uintValue.GetType().Name, uintValue, 
                  bigIntValue.Equals(uintValue))

Dim longValue As Long = -123822229012
bigIntValue = New BigInteger(longValue)
Console.WriteLine("{0} {1} = {2} {3} : {4}", 
                  bigIntValue.GetType().Name, bigIntValue,
                  longValue.GetType().Name, longValue, 
                  bigIntValue.Equals(longValue))
' The example displays the following output:
'    BigInteger 16 = Byte 16 : True
'    BigInteger -16 = SByte -16 : True
'    BigInteger 1233 = Int16 1233 : True
'    BigInteger 64000 = UInt16 64000 : True
'    BigInteger -1603854 = Int32 -1603854 : True
'    BigInteger 1223300 = UInt32 1223300 : True
'    BigInteger -123822229012 = Int64 -123822229012 : True

注釈

otherByteInt16Int32SByteUInt16、または UInt32 値の場合、メソッドが呼び出されると、暗黙的に Int64 値に変換されます。If other is a Byte, Int16, Int32, SByte, UInt16, or UInt32 value, it is implicitly converted to an Int64 value when the method is called.

等しいかどうかをテストするだけでなく、2つのオブジェクト間の関係を確認するには、BigInteger.CompareTo(Int64) メソッドを呼び出します。To determine the relationship between the two objects instead of just testing for equality, call the BigInteger.CompareTo(Int64) method.

Equals(BigInteger)

現在のインスタンスの値と指定された BigInteger オブジェクトの値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and a specified BigInteger object have the same value.

public:
 virtual bool Equals(System::Numerics::BigInteger other);
public bool Equals (System.Numerics.BigInteger other);
override this.Equals : System.Numerics.BigInteger -> bool
Public Function Equals (other As BigInteger) As Boolean

パラメーター

other
BigInteger

比較するオブジェクト。The object to compare.

戻り値

Boolean

この BigInteger オブジェクトの値と other の値が等しい場合は true。それ以外の場合は falsetrue if this BigInteger object and other have the same value; otherwise, false.

実装

次の例では、地球からの2つの星のおおよその距離を比較して、地球からのイプシロンが等しいかどうかを判断します。The following example compares the approximate distance of several stars from Earth with the distance of Epsilon Indi from Earth to determine whether they are equal. この例では、Equals メソッドの各オーバーロードを使用して、等しいかどうかをテストします。The example uses each overload of the Equals method to test for equality.

#using <System.Numerics.dll>

using namespace System;
using namespace System::Numerics;


void main()
{
   const Int64 LIGHT_YEAR = 5878625373183;

   BigInteger altairDistance = 17 * LIGHT_YEAR;
   BigInteger epsilonIndiDistance = 12 * LIGHT_YEAR;
   BigInteger ursaeMajoris47Distance = 46 * LIGHT_YEAR;
   Int64 tauCetiDistance = 12 * LIGHT_YEAR;
   UInt64 procyon2Distance = 12 * LIGHT_YEAR;
   Object^ wolf424ABDistance = 14 * LIGHT_YEAR;

   Console::WriteLine("Approx. equal distances from Epsilon Indi to:");
   Console::WriteLine("   Altair: {0}",
      epsilonIndiDistance.Equals(altairDistance));
   Console::WriteLine("   Ursae Majoris 47: {0}",
      epsilonIndiDistance.Equals(ursaeMajoris47Distance));
   Console::WriteLine("   TauCeti: {0}",
      epsilonIndiDistance.Equals(tauCetiDistance));
   Console::WriteLine("   Procyon 2: {0}",
      epsilonIndiDistance.Equals(procyon2Distance));
   Console::WriteLine("   Wolf 424 AB: {0}",
      epsilonIndiDistance.Equals(wolf424ABDistance));
}
/*
The example displays output like the following:
      Approx. equal distances from Epsilon Indi to:
      Altair: False
      Ursae Majoris 47: False
      TauCeti: True
      Procyon 2: True
      Wolf 424 AB: False
*/
const long LIGHT_YEAR = 5878625373183;

BigInteger altairDistance = 17 * LIGHT_YEAR;
BigInteger epsilonIndiDistance = 12 * LIGHT_YEAR;
BigInteger ursaeMajoris47Distance = 46 * LIGHT_YEAR;
long tauCetiDistance = 12 * LIGHT_YEAR;
ulong procyon2Distance = 12 * LIGHT_YEAR;
object wolf424ABDistance = 14 * LIGHT_YEAR;

Console.WriteLine("Approx. equal distances from Epsilon Indi to:");
Console.WriteLine("   Altair: {0}",
                  epsilonIndiDistance.Equals(altairDistance));
Console.WriteLine("   Ursae Majoris 47: {0}",
                  epsilonIndiDistance.Equals(ursaeMajoris47Distance));
Console.WriteLine("   TauCeti: {0}",
                  epsilonIndiDistance.Equals(tauCetiDistance));
Console.WriteLine("   Procyon 2: {0}",
                  epsilonIndiDistance.Equals(procyon2Distance));
Console.WriteLine("   Wolf 424 AB: {0}",
                  epsilonIndiDistance.Equals(wolf424ABDistance));
// The example displays the following output:
//    Approx. equal distances from Epsilon Indi to:
//       Altair: False
//       Ursae Majoris 47: False
//       TauCeti: True
//       Procyon 2: True
//       Wolf 424 AB: False
   Const LIGHT_YEAR As Long = 5878625373183

   Dim altairDistance As BigInteger = 17 * LIGHT_YEAR
   Dim epsilonIndiDistance As BigInteger = 12 * LIGHT_YEAR
   Dim ursaeMajoris47Distance As BigInteger = 46 * LIGHT_YEAR
   Dim tauCetiDistance As BigInteger = 12 * LIGHT_YEAR
   Dim procyon2Distance As Long = 12 * LIGHT_YEAR
   Dim wolf424ABDistance As Object = 14 * LIGHT_YEAR
   
   Console.WriteLine("Approx. equal distances from Epsilon Indi to:")
   Console.WriteLine("   Altair: {0}", _
                     epsilonIndiDistance.Equals(altairDistance))
   Console.WriteLine("   Ursae Majoris 47: {0}", _
                     epsilonIndiDistance.Equals(ursaeMajoris47Distance))
   Console.WriteLine("   TauCeti: {0}", _
                     epsilonIndiDistance.Equals(tauCetiDistance))
   Console.WriteLine("   Procyon 2: {0}", _
                     epsilonIndiDistance.Equals(procyon2Distance))
   Console.WriteLine("   Wolf 424 AB: {0}", _
                     epsilonIndiDistance.Equals(wolf424ABDistance))
   ' The example displays the following output:
   '    Approx. equal distances from Epsilon Indi to:
   '       Altair: False
   '       Ursae Majoris 47: False
   '       TauCeti: True
   '       Procyon 2: True
   '       Wolf 424 AB: False

注釈

このメソッドは、IEquatable<T> インターフェイスを実装し、other パラメーターを BigInteger オブジェクトに変換する必要がないため、Equals(Object) より少しのパフォーマンスを発揮します。This method implements the IEquatable<T> interface and performs slightly better than Equals(Object) because it does not have to convert the other parameter to a BigInteger object.

等しいかどうかをテストするだけでなく、2つの BigInteger オブジェクト間の関係を確認するには、BigInteger.CompareTo(BigInteger) メソッドを呼び出します。To determine the relationship between the two BigInteger objects instead of just testing for equality, call the BigInteger.CompareTo(BigInteger) method.

Equals(Object)

現在のインスタンスの値と指定されたオブジェクトの値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and a specified object have the same value.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

パラメーター

obj
Object

比較するオブジェクト。The object to compare.

戻り値

Boolean

obj 引数が BigInteger オブジェクトで、その値が現在の BigInteger インスタンスの値と等しい場合は true。それ以外の場合は falsetrue if the obj argument is a BigInteger object, and its value is equal to the value of the current BigInteger instance; otherwise, false.

次の例では、並列 ObjectBigInteger 配列を定義します。The following example defines parallel Object and BigInteger arrays. 1つの配列の各要素は、2番目の配列の対応する要素と同じ値を持ちます。Each element of one array has the same value as the corresponding element of the second array. この例の出力に示すように、BigInteger 配列内のインスタンスは、後者が BigInteger であり、その値が等しい場合にのみ、Object 配列内のインスタンスと等しいと見なされます。As the output from the example shows, the instance in the BigInteger array is considered to be equal to the instance in the Object array only if the latter is a BigInteger and their values are equal.

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      object[] obj = { 0, 10, 100, new BigInteger(1000), -10 };
      BigInteger[] bi = { BigInteger.Zero, new BigInteger(10),
                          new BigInteger(100), new BigInteger(1000),
                          new BigInteger(-10) };
      for (int ctr = 0; ctr < bi.Length; ctr++)
         Console.WriteLine(bi[ctr].Equals(obj[ctr]));
   }
}
// The example displays the following output:
//       False
//       False
//       False
//       True
//       False
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim obj() As object = { 0, 10, 100, New BigInteger(1000), -10 }
      Dim bi() As BigInteger = { BigInteger.Zero, New BigInteger(10),
                                 New BigInteger(100), New BigInteger(1000),
                                 New BigInteger(-10) }
      For ctr As Integer = 0 To bi.Length - 1
         Console.WriteLine(bi(ctr).Equals(obj(ctr)))
      Next                           
   End Sub
End Module
' The example displays the following output:
'       False
'       False
'       False
'       True
'       False

注釈

obj 引数が BigInteger 値でない場合、メソッドは falseを返します。If the obj argument is not a BigInteger value, the method returns false. このメソッドは、obj が現在のインスタンスと等しい値を持つ BigInteger インスタンスである場合にのみ true を返します。The method returns true only if obj is a BigInteger instance whose value is equal to the current instance.

等しいかどうかをテストするだけでなく、2つのオブジェクト間の関係を確認するには、CompareTo(Object) メソッドを呼び出します。To determine the relationship between the two objects instead of just testing for equality, call the CompareTo(Object) method.

Equals(UInt64)

重要

この API は CLS 準拠ではありません。

現在のインスタンスの値と符号なし 64 ビット整数の値が等しいかどうかを示す値を返します。Returns a value that indicates whether the current instance and an unsigned 64-bit integer have the same value.

public:
 bool Equals(System::UInt64 other);
[System.CLSCompliant(false)]
public bool Equals (ulong other);
override this.Equals : uint64 -> bool
Public Function Equals (other As ULong) As Boolean

パラメーター

other
UInt64

比較する符号なし 64 ビット整数。The unsigned 64-bit integer to compare.

戻り値

Boolean

現在のインスタンスの値と符号なし 64 ビット整数の値が等しい場合は true。それ以外の場合は、falsetrue if the current instance and the unsigned 64-bit integer have the same value; otherwise, false.

属性

次の例では、地球からの2つの星のおおよその距離を比較して、地球からのイプシロンが等しいかどうかを判断します。The following example compares the approximate distance of several stars from Earth with the distance of Epsilon Indi from Earth to determine whether they are equal. この例では、Equals メソッドの各オーバーロードを使用して、等しいかどうかをテストします。The example uses each overload of the Equals method to test for equality.

#using <System.Numerics.dll>

using namespace System;
using namespace System::Numerics;


void main()
{
   const Int64 LIGHT_YEAR = 5878625373183;

   BigInteger altairDistance = 17 * LIGHT_YEAR;
   BigInteger epsilonIndiDistance = 12 * LIGHT_YEAR;
   BigInteger ursaeMajoris47Distance = 46 * LIGHT_YEAR;
   Int64 tauCetiDistance = 12 * LIGHT_YEAR;
   UInt64 procyon2Distance = 12 * LIGHT_YEAR;
   Object^ wolf424ABDistance = 14 * LIGHT_YEAR;

   Console::WriteLine("Approx. equal distances from Epsilon Indi to:");
   Console::WriteLine("   Altair: {0}",
      epsilonIndiDistance.Equals(altairDistance));
   Console::WriteLine("   Ursae Majoris 47: {0}",
      epsilonIndiDistance.Equals(ursaeMajoris47Distance));
   Console::WriteLine("   TauCeti: {0}",
      epsilonIndiDistance.Equals(tauCetiDistance));
   Console::WriteLine("   Procyon 2: {0}",
      epsilonIndiDistance.Equals(procyon2Distance));
   Console::WriteLine("   Wolf 424 AB: {0}",
      epsilonIndiDistance.Equals(wolf424ABDistance));
}
/*
The example displays output like the following:
      Approx. equal distances from Epsilon Indi to:
      Altair: False
      Ursae Majoris 47: False
      TauCeti: True
      Procyon 2: True
      Wolf 424 AB: False
*/
const long LIGHT_YEAR = 5878625373183;

BigInteger altairDistance = 17 * LIGHT_YEAR;
BigInteger epsilonIndiDistance = 12 * LIGHT_YEAR;
BigInteger ursaeMajoris47Distance = 46 * LIGHT_YEAR;
long tauCetiDistance = 12 * LIGHT_YEAR;
ulong procyon2Distance = 12 * LIGHT_YEAR;
object wolf424ABDistance = 14 * LIGHT_YEAR;

Console.WriteLine("Approx. equal distances from Epsilon Indi to:");
Console.WriteLine("   Altair: {0}",
                  epsilonIndiDistance.Equals(altairDistance));
Console.WriteLine("   Ursae Majoris 47: {0}",
                  epsilonIndiDistance.Equals(ursaeMajoris47Distance));
Console.WriteLine("   TauCeti: {0}",
                  epsilonIndiDistance.Equals(tauCetiDistance));
Console.WriteLine("   Procyon 2: {0}",
                  epsilonIndiDistance.Equals(procyon2Distance));
Console.WriteLine("   Wolf 424 AB: {0}",
                  epsilonIndiDistance.Equals(wolf424ABDistance));
// The example displays the following output:
//    Approx. equal distances from Epsilon Indi to:
//       Altair: False
//       Ursae Majoris 47: False
//       TauCeti: True
//       Procyon 2: True
//       Wolf 424 AB: False
   Const LIGHT_YEAR As Long = 5878625373183

   Dim altairDistance As BigInteger = 17 * LIGHT_YEAR
   Dim epsilonIndiDistance As BigInteger = 12 * LIGHT_YEAR
   Dim ursaeMajoris47Distance As BigInteger = 46 * LIGHT_YEAR
   Dim tauCetiDistance As BigInteger = 12 * LIGHT_YEAR
   Dim procyon2Distance As Long = 12 * LIGHT_YEAR
   Dim wolf424ABDistance As Object = 14 * LIGHT_YEAR
   
   Console.WriteLine("Approx. equal distances from Epsilon Indi to:")
   Console.WriteLine("   Altair: {0}", _
                     epsilonIndiDistance.Equals(altairDistance))
   Console.WriteLine("   Ursae Majoris 47: {0}", _
                     epsilonIndiDistance.Equals(ursaeMajoris47Distance))
   Console.WriteLine("   TauCeti: {0}", _
                     epsilonIndiDistance.Equals(tauCetiDistance))
   Console.WriteLine("   Procyon 2: {0}", _
                     epsilonIndiDistance.Equals(procyon2Distance))
   Console.WriteLine("   Wolf 424 AB: {0}", _
                     epsilonIndiDistance.Equals(wolf424ABDistance))
   ' The example displays the following output:
   '    Approx. equal distances from Epsilon Indi to:
   '       Altair: False
   '       Ursae Majoris 47: False
   '       TauCeti: True
   '       Procyon 2: True
   '       Wolf 424 AB: False

注釈

等しいかどうかをテストするだけでなく、2つのオブジェクト間の関係を確認するには、BigInteger.CompareTo(UInt64) メソッドを呼び出します。To determine the relationship between the two objects instead of just testing for equality, call the BigInteger.CompareTo(UInt64) method.

適用対象