BigInteger Struktur

Definisi

Mewakili bilangan bulat bertanda tangan yang sangat besar.

public value class BigInteger : IComparable, IComparable<System::Numerics::BigInteger>, IEquatable<System::Numerics::BigInteger>, IFormattable
public value class BigInteger : IComparable<System::Numerics::BigInteger>, IEquatable<System::Numerics::BigInteger>, IParsable<System::Numerics::BigInteger>, ISpanParsable<System::Numerics::BigInteger>, IUtf8SpanParsable<System::Numerics::BigInteger>, System::Numerics::IAdditionOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IAdditiveIdentity<System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IBinaryInteger<System::Numerics::BigInteger>, System::Numerics::IBinaryNumber<System::Numerics::BigInteger>, System::Numerics::IBitwiseOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IComparisonOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, bool>, System::Numerics::IDecrementOperators<System::Numerics::BigInteger>, System::Numerics::IDivisionOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IEqualityOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, bool>, System::Numerics::IIncrementOperators<System::Numerics::BigInteger>, System::Numerics::IModulusOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IMultiplicativeIdentity<System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IMultiplyOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::INumber<System::Numerics::BigInteger>, System::Numerics::INumberBase<System::Numerics::BigInteger>, System::Numerics::IShiftOperators<System::Numerics::BigInteger, int, System::Numerics::BigInteger>, System::Numerics::ISignedNumber<System::Numerics::BigInteger>, System::Numerics::ISubtractionOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IUnaryNegationOperators<System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IUnaryPlusOperators<System::Numerics::BigInteger, System::Numerics::BigInteger>
public value class BigInteger : IComparable, IComparable<System::Numerics::BigInteger>, IEquatable<System::Numerics::BigInteger>, ISpanFormattable
public value class BigInteger : IComparable<System::Numerics::BigInteger>, IEquatable<System::Numerics::BigInteger>, IParsable<System::Numerics::BigInteger>, ISpanParsable<System::Numerics::BigInteger>, System::Numerics::IAdditionOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IAdditiveIdentity<System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IBinaryInteger<System::Numerics::BigInteger>, System::Numerics::IBinaryNumber<System::Numerics::BigInteger>, System::Numerics::IBitwiseOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IComparisonOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, bool>, System::Numerics::IDecrementOperators<System::Numerics::BigInteger>, System::Numerics::IDivisionOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IEqualityOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, bool>, System::Numerics::IIncrementOperators<System::Numerics::BigInteger>, System::Numerics::IModulusOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IMultiplicativeIdentity<System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IMultiplyOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::INumber<System::Numerics::BigInteger>, System::Numerics::INumberBase<System::Numerics::BigInteger>, System::Numerics::IShiftOperators<System::Numerics::BigInteger, int, System::Numerics::BigInteger>, System::Numerics::ISignedNumber<System::Numerics::BigInteger>, System::Numerics::ISubtractionOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IUnaryNegationOperators<System::Numerics::BigInteger, System::Numerics::BigInteger>, System::Numerics::IUnaryPlusOperators<System::Numerics::BigInteger, System::Numerics::BigInteger>
public struct BigInteger : IComparable, IComparable<System.Numerics.BigInteger>, IEquatable<System.Numerics.BigInteger>, IFormattable
public readonly struct BigInteger : IComparable<System.Numerics.BigInteger>, IEquatable<System.Numerics.BigInteger>, IParsable<System.Numerics.BigInteger>, ISpanParsable<System.Numerics.BigInteger>, IUtf8SpanParsable<System.Numerics.BigInteger>, System.Numerics.IAdditionOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IAdditiveIdentity<System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IBinaryInteger<System.Numerics.BigInteger>, System.Numerics.IBinaryNumber<System.Numerics.BigInteger>, System.Numerics.IBitwiseOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IComparisonOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,bool>, System.Numerics.IDecrementOperators<System.Numerics.BigInteger>, System.Numerics.IDivisionOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IEqualityOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,bool>, System.Numerics.IIncrementOperators<System.Numerics.BigInteger>, System.Numerics.IModulusOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IMultiplicativeIdentity<System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IMultiplyOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.INumber<System.Numerics.BigInteger>, System.Numerics.INumberBase<System.Numerics.BigInteger>, System.Numerics.IShiftOperators<System.Numerics.BigInteger,int,System.Numerics.BigInteger>, System.Numerics.ISignedNumber<System.Numerics.BigInteger>, System.Numerics.ISubtractionOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IUnaryNegationOperators<System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IUnaryPlusOperators<System.Numerics.BigInteger,System.Numerics.BigInteger>
public readonly struct BigInteger : IComparable, IComparable<System.Numerics.BigInteger>, IEquatable<System.Numerics.BigInteger>, IFormattable
public readonly struct BigInteger : IComparable, IComparable<System.Numerics.BigInteger>, IEquatable<System.Numerics.BigInteger>, ISpanFormattable
public readonly struct BigInteger : IComparable<System.Numerics.BigInteger>, IEquatable<System.Numerics.BigInteger>, IParsable<System.Numerics.BigInteger>, ISpanParsable<System.Numerics.BigInteger>, System.Numerics.IAdditionOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IAdditiveIdentity<System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IBinaryInteger<System.Numerics.BigInteger>, System.Numerics.IBinaryNumber<System.Numerics.BigInteger>, System.Numerics.IBitwiseOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IComparisonOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,bool>, System.Numerics.IDecrementOperators<System.Numerics.BigInteger>, System.Numerics.IDivisionOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IEqualityOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,bool>, System.Numerics.IIncrementOperators<System.Numerics.BigInteger>, System.Numerics.IModulusOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IMultiplicativeIdentity<System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IMultiplyOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.INumber<System.Numerics.BigInteger>, System.Numerics.INumberBase<System.Numerics.BigInteger>, System.Numerics.IShiftOperators<System.Numerics.BigInteger,int,System.Numerics.BigInteger>, System.Numerics.ISignedNumber<System.Numerics.BigInteger>, System.Numerics.ISubtractionOperators<System.Numerics.BigInteger,System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IUnaryNegationOperators<System.Numerics.BigInteger,System.Numerics.BigInteger>, System.Numerics.IUnaryPlusOperators<System.Numerics.BigInteger,System.Numerics.BigInteger>
[System.Serializable]
public struct BigInteger : IComparable, IComparable<System.Numerics.BigInteger>, IEquatable<System.Numerics.BigInteger>, IFormattable
type BigInteger = struct
    interface IFormattable
type BigInteger = struct
    interface IFormattable
    interface IParsable<BigInteger>
    interface ISpanFormattable
    interface ISpanParsable<BigInteger>
    interface IAdditionOperators<BigInteger, BigInteger, BigInteger>
    interface IAdditiveIdentity<BigInteger, BigInteger>
    interface IBinaryInteger<BigInteger>
    interface IBinaryNumber<BigInteger>
    interface IBitwiseOperators<BigInteger, BigInteger, BigInteger>
    interface IComparisonOperators<BigInteger, BigInteger, bool>
    interface IEqualityOperators<BigInteger, BigInteger, bool>
    interface IDecrementOperators<BigInteger>
    interface IDivisionOperators<BigInteger, BigInteger, BigInteger>
    interface IIncrementOperators<BigInteger>
    interface IModulusOperators<BigInteger, BigInteger, BigInteger>
    interface IMultiplicativeIdentity<BigInteger, BigInteger>
    interface IMultiplyOperators<BigInteger, BigInteger, BigInteger>
    interface INumber<BigInteger>
    interface INumberBase<BigInteger>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<BigInteger>
    interface ISubtractionOperators<BigInteger, BigInteger, BigInteger>
    interface IUnaryNegationOperators<BigInteger, BigInteger>
    interface IUnaryPlusOperators<BigInteger, BigInteger>
    interface IShiftOperators<BigInteger, int, BigInteger>
    interface ISignedNumber<BigInteger>
type BigInteger = struct
    interface IFormattable
    interface IParsable<BigInteger>
    interface ISpanFormattable
    interface ISpanParsable<BigInteger>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<BigInteger>
    interface IAdditionOperators<BigInteger, BigInteger, BigInteger>
    interface IAdditiveIdentity<BigInteger, BigInteger>
    interface IBinaryInteger<BigInteger>
    interface IBinaryNumber<BigInteger>
    interface IBitwiseOperators<BigInteger, BigInteger, BigInteger>
    interface IComparisonOperators<BigInteger, BigInteger, bool>
    interface IEqualityOperators<BigInteger, BigInteger, bool>
    interface IDecrementOperators<BigInteger>
    interface IDivisionOperators<BigInteger, BigInteger, BigInteger>
    interface IIncrementOperators<BigInteger>
    interface IModulusOperators<BigInteger, BigInteger, BigInteger>
    interface IMultiplicativeIdentity<BigInteger, BigInteger>
    interface IMultiplyOperators<BigInteger, BigInteger, BigInteger>
    interface INumber<BigInteger>
    interface INumberBase<BigInteger>
    interface ISubtractionOperators<BigInteger, BigInteger, BigInteger>
    interface IUnaryNegationOperators<BigInteger, BigInteger>
    interface IUnaryPlusOperators<BigInteger, BigInteger>
    interface IShiftOperators<BigInteger, int, BigInteger>
    interface ISignedNumber<BigInteger>
type BigInteger = struct
    interface ISpanFormattable
    interface IFormattable
type BigInteger = struct
    interface IFormattable
    interface IParsable<BigInteger>
    interface ISpanFormattable
    interface ISpanParsable<BigInteger>
    interface IAdditionOperators<BigInteger, BigInteger, BigInteger>
    interface IAdditiveIdentity<BigInteger, BigInteger>
    interface IBinaryInteger<BigInteger>
    interface IBinaryNumber<BigInteger>
    interface IBitwiseOperators<BigInteger, BigInteger, BigInteger>
    interface IComparisonOperators<BigInteger, BigInteger, bool>
    interface IEqualityOperators<BigInteger, BigInteger, bool>
    interface IDecrementOperators<BigInteger>
    interface IDivisionOperators<BigInteger, BigInteger, BigInteger>
    interface IIncrementOperators<BigInteger>
    interface IModulusOperators<BigInteger, BigInteger, BigInteger>
    interface IMultiplicativeIdentity<BigInteger, BigInteger>
    interface IMultiplyOperators<BigInteger, BigInteger, BigInteger>
    interface INumber<BigInteger>
    interface INumberBase<BigInteger>
    interface ISubtractionOperators<BigInteger, BigInteger, BigInteger>
    interface IUnaryNegationOperators<BigInteger, BigInteger>
    interface IUnaryPlusOperators<BigInteger, BigInteger>
    interface IShiftOperators<BigInteger, int, BigInteger>
    interface ISignedNumber<BigInteger>
type BigInteger = struct
    interface IFormattable
    interface IParsable<BigInteger>
    interface ISpanFormattable
    interface ISpanParsable<BigInteger>
    interface IAdditionOperators<BigInteger, BigInteger, BigInteger>
    interface IAdditiveIdentity<BigInteger, BigInteger>
    interface IBinaryInteger<BigInteger>
    interface IBinaryNumber<BigInteger>
    interface IBitwiseOperators<BigInteger, BigInteger, BigInteger>
    interface IComparisonOperators<BigInteger, BigInteger, bool>
    interface IEqualityOperators<BigInteger, BigInteger, bool>
    interface IDecrementOperators<BigInteger>
    interface IDivisionOperators<BigInteger, BigInteger, BigInteger>
    interface IIncrementOperators<BigInteger>
    interface IModulusOperators<BigInteger, BigInteger, BigInteger>
    interface IMultiplicativeIdentity<BigInteger, BigInteger>
    interface IMultiplyOperators<BigInteger, BigInteger, BigInteger>
    interface INumber<BigInteger>
    interface INumberBase<BigInteger>
    interface ISubtractionOperators<BigInteger, BigInteger, BigInteger>
    interface IUnaryNegationOperators<BigInteger, BigInteger>
    interface IUnaryPlusOperators<BigInteger, BigInteger>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<BigInteger>
    interface IShiftOperators<BigInteger, int, BigInteger>
    interface ISignedNumber<BigInteger>
[<System.Serializable>]
type BigInteger = struct
    interface IFormattable
Public Structure BigInteger
Implements IComparable, IComparable(Of BigInteger), IEquatable(Of BigInteger), IFormattable
Public Structure BigInteger
Implements IAdditionOperators(Of BigInteger, BigInteger, BigInteger), IAdditiveIdentity(Of BigInteger, BigInteger), IBinaryInteger(Of BigInteger), IBinaryNumber(Of BigInteger), IBitwiseOperators(Of BigInteger, BigInteger, BigInteger), IComparable(Of BigInteger), IComparisonOperators(Of BigInteger, BigInteger, Boolean), IDecrementOperators(Of BigInteger), IDivisionOperators(Of BigInteger, BigInteger, BigInteger), IEqualityOperators(Of BigInteger, BigInteger, Boolean), IEquatable(Of BigInteger), IIncrementOperators(Of BigInteger), IModulusOperators(Of BigInteger, BigInteger, BigInteger), IMultiplicativeIdentity(Of BigInteger, BigInteger), IMultiplyOperators(Of BigInteger, BigInteger, BigInteger), INumber(Of BigInteger), INumberBase(Of BigInteger), IParsable(Of BigInteger), IShiftOperators(Of BigInteger, Integer, BigInteger), ISignedNumber(Of BigInteger), ISpanParsable(Of BigInteger), ISubtractionOperators(Of BigInteger, BigInteger, BigInteger), IUnaryNegationOperators(Of BigInteger, BigInteger), IUnaryPlusOperators(Of BigInteger, BigInteger), IUtf8SpanParsable(Of BigInteger)
Public Structure BigInteger
Implements IComparable, IComparable(Of BigInteger), IEquatable(Of BigInteger), ISpanFormattable
Public Structure BigInteger
Implements IAdditionOperators(Of BigInteger, BigInteger, BigInteger), IAdditiveIdentity(Of BigInteger, BigInteger), IBinaryInteger(Of BigInteger), IBinaryNumber(Of BigInteger), IBitwiseOperators(Of BigInteger, BigInteger, BigInteger), IComparable(Of BigInteger), IComparisonOperators(Of BigInteger, BigInteger, Boolean), IDecrementOperators(Of BigInteger), IDivisionOperators(Of BigInteger, BigInteger, BigInteger), IEqualityOperators(Of BigInteger, BigInteger, Boolean), IEquatable(Of BigInteger), IIncrementOperators(Of BigInteger), IModulusOperators(Of BigInteger, BigInteger, BigInteger), IMultiplicativeIdentity(Of BigInteger, BigInteger), IMultiplyOperators(Of BigInteger, BigInteger, BigInteger), INumber(Of BigInteger), INumberBase(Of BigInteger), IParsable(Of BigInteger), IShiftOperators(Of BigInteger, Integer, BigInteger), ISignedNumber(Of BigInteger), ISpanParsable(Of BigInteger), ISubtractionOperators(Of BigInteger, BigInteger, BigInteger), IUnaryNegationOperators(Of BigInteger, BigInteger), IUnaryPlusOperators(Of BigInteger, BigInteger)
Warisan
BigInteger
Atribut
Penerapan
IComparable IComparable<BigInteger> IEquatable<BigInteger> IFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<BigInteger> IParsable<TSelf> ISpanFormattable ISpanParsable<BigInteger> ISpanParsable<TSelf> IUtf8SpanFormattable IUtf8SpanParsable<BigInteger> IUtf8SpanParsable<TSelf> IAdditionOperators<BigInteger,BigInteger,BigInteger> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<BigInteger,BigInteger> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<BigInteger> IBinaryNumber<BigInteger> IBinaryNumber<TSelf> IBitwiseOperators<BigInteger,BigInteger,BigInteger> IBitwiseOperators<TSelf,TSelf,TSelf> IComparisonOperators<BigInteger,BigInteger,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<BigInteger> IDecrementOperators<TSelf> IDivisionOperators<BigInteger,BigInteger,BigInteger> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<BigInteger,BigInteger,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<BigInteger> IIncrementOperators<TSelf> IModulusOperators<BigInteger,BigInteger,BigInteger> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<BigInteger,BigInteger> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<BigInteger,BigInteger,BigInteger> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<BigInteger> INumber<TSelf> INumberBase<BigInteger> INumberBase<TSelf> IShiftOperators<BigInteger,Int32,BigInteger> IShiftOperators<TSelf,Int32,TSelf> ISignedNumber<BigInteger> ISubtractionOperators<BigInteger,BigInteger,BigInteger> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<BigInteger,BigInteger> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<BigInteger,BigInteger> IUnaryPlusOperators<TSelf,TSelf>

Keterangan

Jenis BigInteger adalah jenis yang tidak dapat diubah yang mewakili bilangan bulat besar yang nilainya secara teori tidak memiliki batas atas atau bawah. Anggota tipe BigInteger mirip dengan tipe integral lainnya (tipe Byte, Int16, Int32, Int64, SByte, UInt16, UInt32, dan UInt64). Jenis ini berbeda dari jenis integral lainnya di .NET, yang memiliki rentang yang ditunjukkan oleh properti MinValue dan MaxValue mereka.

Note

Karena jenis BigInteger tidak dapat diubah (lihat Mutabilitas) dan karena tidak memiliki batas atas atau bawah, OutOfMemoryException dapat dilemparkan untuk operasi apa pun yang menyebabkan nilai BigInteger tumbuh terlalu besar.

Menginstansiasi objek BigInteger

Anda dapat membuat instans objek BigInteger dengan beberapa cara:

  • Anda dapat menggunakan kata kunci new dan memberikan nilai integral atau floating-point sebagai parameter ke konstruktor BigInteger. (Nilai floating-point dipotong sebelum ditetapkan ke BigInteger.) Contoh berikut mengilustrasikan cara menggunakan kata kunci new untuk membuat instans nilai BigInteger.

    BigInteger bigIntFromDouble = new BigInteger(179032.6541);
    Console.WriteLine(bigIntFromDouble);
    BigInteger bigIntFromInt64 = new BigInteger(934157136952);
    Console.WriteLine(bigIntFromInt64);
    // The example displays the following output:
    //   179032
    //   934157136952
    
    Dim bigIntFromDouble As New BigInteger(179032.6541)
    Console.WriteLine(bigIntFromDouble)
    Dim bigIntFromInt64 As New BigInteger(934157136952)
    Console.WriteLine(bigIntFromInt64)
    ' The example displays the following output:
    '   179032
    '   934157136952
    
  • Anda dapat mendeklarasikan variabel BigInteger dan menetapkannya nilai seperti jenis numerik apa pun, selama nilai tersebut adalah jenis integral. Contoh berikut menggunakan penugasan untuk membuat nilai BigInteger dari Int64.

    long longValue = 6315489358112;
    BigInteger assignedFromLong = longValue;
    Console.WriteLine(assignedFromLong);
    // The example displays the following output:
    //   6315489358112
    
    Dim longValue As Long = 6315489358112
    Dim assignedFromLong As BigInteger = longValue
    Console.WriteLine(assignedFromLong)
    ' The example displays the following output:
    '   6315489358112
    
  • Anda dapat menetapkan nilai desimal atau floating-point ke objek BigInteger jika Anda mentransmisikan nilai atau mengonversinya terlebih dahulu. Contoh berikut secara eksplisit melemparkan (dalam C#) atau mengonversi (di Visual Basic) nilai Double dan Decimal menjadi BigInteger.

    BigInteger assignedFromDouble = (BigInteger) 179032.6541;
    Console.WriteLine(assignedFromDouble);
    BigInteger assignedFromDecimal = (BigInteger) 64312.65m;
    Console.WriteLine(assignedFromDecimal);
    // The example displays the following output:
    //   179032
    //   64312
    
    Dim assignedFromDouble As BigInteger = CType(179032.6541, BigInteger)
    Console.WriteLine(assignedFromDouble)
    Dim assignedFromDecimal As BigInteger = CType(64312.65D, BigInteger)
    Console.WriteLine(assignedFromDecimal)
    ' The example displays the following output:
    '   179032
    '   64312
    

Metode ini memungkinkan Anda membuat instans objek BigInteger yang nilainya berada dalam rentang salah satu jenis numerik yang ada saja. Anda dapat membuat instans objek BigInteger yang nilainya dapat melebihi rentang jenis numerik yang ada dengan salah satu dari tiga cara:

  • Anda dapat menggunakan kata kunci new dan menyediakan array byte dalam ukuran berapa pun ke konstruktor BigInteger.BigInteger. Contohnya:

    byte[] byteArray = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
    BigInteger newBigInt = new BigInteger(byteArray);
    Console.WriteLine($"The value of newBigInt is {newBigInt} (or 0x{newBigInt:x}).");
    // The example displays the following output:
    //   The value of newBigInt is 4759477275222530853130 (or 0x102030405060708090a).
    
    Dim byteArray() As Byte = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
    Dim newBigInt As New BigInteger(byteArray)
    Console.WriteLine("The value of newBigInt is {0} (or 0x{0:x}).", newBigInt)
    ' The example displays the following output:
    '   The value of newBigInt is 4759477275222530853130 (or 0x102030405060708090a).
    
  • Anda dapat memanggil metode Parse atau TryParse untuk mengonversi representasi string angka menjadi BigInteger. Contohnya:

    string positiveString = "91389681247993671255432112000000";
    string negativeString = "-90315837410896312071002088037140000";
    BigInteger posBigInt = 0;
    BigInteger negBigInt = 0;
    
    try {
       posBigInt = BigInteger.Parse(positiveString);
       Console.WriteLine(posBigInt);
    }
    catch (FormatException)
    {
       Console.WriteLine($"Unable to convert the string '{positiveString}' to a BigInteger value.");
    }
    
    if (BigInteger.TryParse(negativeString, out negBigInt))
      Console.WriteLine(negBigInt);
    else
       Console.WriteLine($"Unable to convert the string '{negativeString}' to a BigInteger value.");
    
    // The example displays the following output:
    //   9.1389681247993671255432112E+31
    //   -9.0315837410896312071002088037E+34
    
    Dim positiveString As String = "91389681247993671255432112000000"
    Dim negativeString As String = "-90315837410896312071002088037140000"
    Dim posBigInt As BigInteger = 0
    Dim negBigInt As BigInteger = 0
    
    Try
        posBigInt = BigInteger.Parse(positiveString)
        Console.WriteLine(posBigInt)
    Catch e As FormatException
        Console.WriteLine("Unable to convert the string '{0}' to a BigInteger value.",
                          positiveString)
    End Try
    
    If BigInteger.TryParse(negativeString, negBigInt) Then
        Console.WriteLine(negBigInt)
    Else
        Console.WriteLine("Unable to convert the string '{0}' to a BigInteger value.",
                           negativeString)
    End If
    ' The example displays the following output:
    '   9.1389681247993671255432112E+31
    '   -9.0315837410896312071002088037E+34
    
  • Anda dapat memanggil metode static (Shared di Visual Basic) BigInteger yang melakukan beberapa operasi pada ekspresi numerik dan mengembalikan hasil BigInteger terhitung. Contoh berikut melakukan ini dengan mengkubik UInt64.MaxValue dan menetapkan hasilnya ke BigInteger.

    BigInteger number = BigInteger.Pow(UInt64.MaxValue, 3);
    Console.WriteLine(number);
    // The example displays the following output:
    //    6277101735386680762814942322444851025767571854389858533375
    
    Dim number As BigInteger = BigInteger.Pow(UInt64.MaxValue, 3)
    Console.WriteLine(number)
    ' The example displays the following output:
    ' 6277101735386680762814942322444851025767571854389858533375
    

Nilai yang tidak diinisialisasi dari BigInteger adalah Zero.

Melakukan operasi pada nilai BigInteger

Anda dapat menggunakan instance BigInteger seperti Anda menggunakan jenis bilangan integral lainnya. BigInteger membebani operator numerik standar untuk memungkinkan Anda melakukan operasi matematika dasar seperti penambahan, pengurangan, pembagian, perkalian, dan negasi unary. Anda juga dapat menggunakan operator numerik standar untuk membandingkan dua nilai BigInteger satu sama lain. Seperti tipe integral lainnya, BigInteger juga mendukung operator bitwise And, Or, XOr, geser kiri, dan geser kanan. Untuk bahasa yang tidak mendukung operator kustom, struktur BigInteger juga menyediakan metode yang setara untuk melakukan operasi matematika. Ini termasuk Add, Divide, Multiply, Negate, Subtract, dan beberapa lainnya.

Banyak anggota struktur BigInteger sesuai langsung dengan anggota jenis integral lainnya. Selain itu, BigInteger menambahkan anggota seperti berikut ini:

Banyak dari anggota tambahan ini sesuai dengan anggota kelas Math, yang menyediakan fungsionalitas untuk bekerja dengan jenis numerik primitif.

Mutabilitas

Contoh berikut membuat instans objek BigInteger lalu menaikkan nilainya satu per satu.

BigInteger number = BigInteger.Multiply(Int64.MaxValue, 3);
number++;
Console.WriteLine(number);
Dim number As BigInteger = BigInteger.Multiply(Int64.MaxValue, 3)
number += 1
Console.WriteLine(number)

Meskipun contoh ini tampaknya mengubah nilai objek yang ada, ini bukan masalahnya. BigInteger objek tidak dapat diubah, yang berarti bahwa secara internal, runtime bahasa umum benar-benar membuat objek BigInteger baru dan menetapkannya nilai yang lebih besar dari nilai sebelumnya. Objek baru ini kemudian dikembalikan ke pemanggil.

Note

Jenis numerik lainnya di .NET juga tidak dapat diubah. Namun, karena jenis BigInteger tidak memiliki batas atas atau bawah, nilainya dapat tumbuh sangat besar dan memiliki dampak yang terukur pada performa.

Meskipun proses ini transparan bagi pemanggil, proses ini menyebabkan penurunan kinerja. Dalam beberapa kasus, terutama ketika operasi berulang dilakukan dalam perulangan pada nilai BigInteger yang sangat besar, penalti performa dapat signifikan. Misalnya, dalam contoh berikut, operasi dilakukan berulang hingga satu juta kali, dan nilai BigInteger bertambah satu kali setiap kali operasi berhasil.

BigInteger number = Int64.MaxValue ^ 5;
int repetitions = 1000000;
// Perform some repetitive operation 1 million times.
for (int ctr = 0; ctr <= repetitions; ctr++)
{
    // Perform some operation. If it fails, exit the loop.
    if (!SomeOperationSucceeds()) break;
    // The following code executes if the operation succeeds.
    number++;
}
Dim number As BigInteger = Int64.MaxValue ^ 5
Dim repetitions As Integer = 1000000
' Perform some repetitive operation 1 million times.
For ctr As Integer = 0 To repetitions
    ' Perform some operation. If it fails, exit the loop.
    If Not SomeOperationSucceeds() Then Exit For
    ' The following code executes if the operation succeeds.
    number += 1
Next

Dalam kasus seperti itu, Anda dapat meningkatkan performa dengan melakukan semua penugasan perantara ke variabel Int32. Nilai akhir variabel kemudian dapat ditetapkan ke objek BigInteger saat perulangan selesai. Contoh berikut memberikan ilustrasi.

BigInteger number = Int64.MaxValue ^ 5;
int repetitions = 1000000;
int actualRepetitions = 0;
// Perform some repetitive operation 1 million times.
for (int ctr = 0; ctr <= repetitions; ctr++)
{
    // Perform some operation. If it fails, exit the loop.
    if (!SomeOperationSucceeds()) break;
    // The following code executes if the operation succeeds.
    actualRepetitions++;
}
number += actualRepetitions;
Dim number As BigInteger = Int64.MaxValue ^ 5
Dim repetitions As Integer = 1000000
Dim actualRepetitions As Integer = 0
' Perform some repetitive operation 1 million times.
For ctr As Integer = 0 To repetitions
    ' Perform some operation. If it fails, exit the loop.
    If Not SomeOperationSucceeds() Then Exit For
    ' The following code executes if the operation succeeds.
    actualRepetitions += 1
Next
number += actualRepetitions

Array byte dan string heksadesimal

Jika Anda mengonversi nilai BigInteger menjadi array byte, atau jika Anda mengonversi array byte menjadi nilai BigInteger, Anda harus mempertimbangkan urutan byte. Struktur BigInteger mengharapkan byte individu dalam array byte muncul dalam urutan little-endian (yaitu, byte dengan urutan lebih rendah dari nilai mendahului byte dengan urutan lebih tinggi). Anda dapat melakukan round-trip nilai BigInteger dengan memanggil metode ToByteArray lalu meneruskan array byte yang dihasilkan ke konstruktor BigInteger(Byte[]), seperti yang ditunjukkan contoh berikut.

BigInteger number = BigInteger.Pow(Int64.MaxValue, 2);
Console.WriteLine(number);

// Write the BigInteger value to a byte array.
byte[] bytes = number.ToByteArray();

// Display the byte array.
foreach (byte byteValue in bytes)
    Console.Write("0x{0:X2} ", byteValue);
Console.WriteLine();

// Restore the BigInteger value from a Byte array.
BigInteger newNumber = new BigInteger(bytes);
Console.WriteLine(newNumber);
// The example displays the following output:
//    8.5070591730234615847396907784E+37
//    0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x3F
//
//    8.5070591730234615847396907784E+37
Dim number As BigInteger = BigInteger.Pow(Int64.MaxValue, 2)     
Console.WriteLine(number)

' Write the BigInteger value to a byte array.
Dim bytes() As Byte = number.ToByteArray()

' Display the byte array.
For Each byteValue As Byte In bytes
   Console.Write("0x{0:X2} ", byteValue)
Next   
Console.WriteLine()

' Restore the BigInteger value from a Byte array.
Dim newNumber As BigInteger = New BigInteger(bytes)
Console.WriteLine(newNumber)               
' The example displays the following output:
'    8.5070591730234615847396907784E+37
'    0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x3F
'    
'    8.5070591730234615847396907784E+37

Untuk membuat instans nilai BigInteger dari array byte yang mewakili nilai dari beberapa jenis integral lainnya, Anda dapat meneruskan nilai integral ke metode BitConverter.GetBytes, lalu meneruskan array byte yang dihasilkan ke konstruktor BigInteger(Byte[]). Contoh berikut membuat instans nilai BigInteger dari array byte yang mewakili nilai Int16.

short originalValue = 30000;
Console.WriteLine(originalValue);

// Convert the Int16 value to a byte array.
byte[] bytes = BitConverter.GetBytes(originalValue);

// Display the byte array.
foreach (byte byteValue in bytes)
    Console.Write("0x{0} ", byteValue.ToString("X2"));
Console.WriteLine();

// Pass byte array to the BigInteger constructor.
BigInteger number = new BigInteger(bytes);
Console.WriteLine(number);
// The example displays the following output:
//       30000
//       0x30 0x75
//       30000
Dim originalValue As Short = 30000
Console.WriteLine(originalValue)

' Convert the Int16 value to a byte array.
Dim bytes() As Byte = BitConverter.GetBytes(originalValue)

' Display the byte array.
For Each byteValue As Byte In bytes
   Console.Write("0x{0} ", byteValue.ToString("X2"))
Next    
Console.WriteLine() 

' Pass byte array to the BigInteger constructor.
Dim number As BigInteger = New BigInteger(bytes)
Console.WriteLine(number)
' The example displays the following output:
'       30000
'       0x30 0x75
'       30000

Struktur BigInteger mengasumsikan bahwa nilai negatif disimpan dengan menggunakan representasi pelengkap dua. Karena struktur BigInteger mewakili nilai numerik tanpa panjang tetap, konstruktor BigInteger(Byte[]) selalu menafsirkan bit yang paling signifikan dari byte terakhir dalam array sebagai bit tanda. Untuk mencegah konstruktor BigInteger(Byte[]) membingungkan representasi pelengkap dua nilai negatif dengan tanda dan representasi besar dari nilai positif, nilai positif di mana bit paling signifikan dari byte terakhir dalam array byte biasanya akan ditetapkan harus menyertakan byte tambahan yang nilainya adalah 0. Misalnya, 0xC0 0xBD 0xF0 0xFF adalah representasi heksadesimal little-endian yang bisa menjadi -1.000.000 atau 4.293.967.296. Karena bit yang paling signifikan dari byte terakhir dalam array ini aktif, nilai array byte akan ditafsirkan oleh konstruktor BigInteger(Byte[]) sebagai -1.000.000. Untuk membuat instans BigInteger yang nilainya positif, array byte yang elemennya 0xC0 0xBD 0xF0 0xFF 0x00 harus diteruskan ke konstruktor. Contoh berikut mengilustrasikan hal ini.

int negativeNumber = -1000000;
uint positiveNumber = 4293967296;

byte[] negativeBytes = BitConverter.GetBytes(negativeNumber);
BigInteger negativeBigInt = new BigInteger(negativeBytes);
Console.WriteLine(negativeBigInt.ToString("N0"));

byte[] tempPosBytes = BitConverter.GetBytes(positiveNumber);
byte[] positiveBytes = new byte[tempPosBytes.Length + 1];
Array.Copy(tempPosBytes, positiveBytes, tempPosBytes.Length);
BigInteger positiveBigInt = new BigInteger(positiveBytes);
Console.WriteLine(positiveBigInt.ToString("N0"));
// The example displays the following output:
//    -1,000,000
//    4,293,967,296
Dim negativeNumber As Integer = -1000000
Dim positiveNumber As UInteger = 4293967296

Dim negativeBytes() As Byte = BitConverter.GetBytes(negativeNumber) 
Dim negativeBigInt As New BigInteger(negativeBytes)
Console.WriteLine(negativeBigInt.ToString("N0"))

Dim tempPosBytes() As Byte = BitConverter.GetBytes(positiveNumber)
Dim positiveBytes(tempposBytes.Length) As Byte
Array.Copy(tempPosBytes, positiveBytes, tempPosBytes.Length)
Dim positiveBigInt As New BigInteger(positiveBytes)
Console.WriteLine(positiveBigInt.ToString("N0")) 
' The example displays the following output:
'    -1,000,000
'    4,293,967,296

Array byte yang dibuat oleh metode ToByteArray dari nilai positif menyertakan byte nilai nol tambahan ini. Oleh karena itu, struktur BigInteger dapat berhasil melakukan konversi bolak-balik nilai dengan menetapkannya ke array byte, lalu memulihkannya dari array byte, seperti yang ditunjukkan contoh berikut.

BigInteger positiveValue = 15777216;
BigInteger negativeValue = -1000000;

Console.WriteLine("Positive value: " + positiveValue.ToString("N0"));
byte[] bytes = positiveValue.ToByteArray();

foreach (byte byteValue in bytes)
    Console.Write("{0:X2} ", byteValue);
Console.WriteLine();
positiveValue = new BigInteger(bytes);
Console.WriteLine("Restored positive value: " + positiveValue.ToString("N0"));

Console.WriteLine();

Console.WriteLine("Negative value: " + negativeValue.ToString("N0"));
bytes = negativeValue.ToByteArray();
foreach (byte byteValue in bytes)
    Console.Write("{0:X2} ", byteValue);
Console.WriteLine();
negativeValue = new BigInteger(bytes);
Console.WriteLine("Restored negative value: " + negativeValue.ToString("N0"));
// The example displays the following output:
//       Positive value: 15,777,216
//       C0 BD F0 00
//       Restored positive value: 15,777,216
//
//       Negative value: -1,000,000
//       C0 BD F0
//       Restored negative value: -1,000,000
Dim positiveValue As BigInteger = 15777216
Dim negativeValue As BigInteger = -1000000

Console.WriteLine("Positive value: " + positiveValue.ToString("N0"))
Dim bytes() As Byte = positiveValue.ToByteArray()
For Each byteValue As Byte In bytes
   Console.Write("{0:X2} ", byteValue)
Next
Console.WriteLine()
positiveValue = New BigInteger(bytes)
Console.WriteLine("Restored positive value: " + positiveValue.ToString("N0"))

Console.WriteLine()
   
Console.WriteLIne("Negative value: " + negativeValue.ToString("N0"))
bytes = negativeValue.ToByteArray()
For Each byteValue As Byte In bytes
   Console.Write("{0:X2} ", byteValue)
Next
Console.WriteLine()
negativeValue = New BigInteger(bytes)
Console.WriteLine("Restored negative value: " + negativeValue.ToString("N0"))
' The example displays the following output:
'       Positive value: 15,777,216
'       C0 BD F0 00
'       Restored positive value: 15,777,216
'       
'       Negative value: -1,000,000
'       C0 BD F0
'       Restored negative value: -1,000,000

Namun, Anda mungkin perlu menambahkan byte nilai nol tambahan ini ke array byte yang dibuat secara dinamis oleh pengembang atau yang dikembalikan oleh metode yang mengonversi integer tak bertanda ke array byte (seperti BitConverter.GetBytes(UInt16), BitConverter.GetBytes(UInt32), dan BitConverter.GetBytes(UInt64)).

Saat mengurai string heksadesimal, metode BigInteger.Parse(String, NumberStyles) dan BigInteger.Parse(String, NumberStyles, IFormatProvider) mengasumsikan bahwa jika bit yang paling signifikan dari byte pertama dalam string diatur, atau jika digit heksadesimal pertama dari string mewakili empat bit yang lebih rendah dari nilai byte, nilai diwakili dengan menggunakan representasi pelengkap dua. Misalnya, "FF01" dan "F01" mewakili nilai desimal -255. Untuk membedakan positif dari nilai negatif, nilai positif harus menyertakan nol di depannya. Kelebihan beban yang relevan dari metode ToString, ketika mereka diteruskan string format "X", tambahkan nol di depan ke string heksadesimal yang dikembalikan untuk nilai positif. Ini memungkinkan untuk melakukan round-trip nilai BigInteger dengan menggunakan metode ToString dan Parse, seperti yang ditunjukkan contoh berikut.

BigInteger negativeNumber = -1000000;
BigInteger positiveNumber = 15777216;

string negativeHex = negativeNumber.ToString("X");
string positiveHex = positiveNumber.ToString("X");

BigInteger negativeNumber2, positiveNumber2;
negativeNumber2 = BigInteger.Parse(negativeHex,
                                   NumberStyles.HexNumber);
positiveNumber2 = BigInteger.Parse(positiveHex,
                                   NumberStyles.HexNumber);

Console.WriteLine($"Converted {negativeNumber:N0} to {negativeHex} back to {negativeNumber2:N0}.");
Console.WriteLine($"Converted {positiveNumber:N0} to {positiveHex} back to {positiveNumber2:N0}.");
// The example displays the following output:
//       Converted -1,000,000 to F0BDC0 back to -1,000,000.
//       Converted 15,777,216 to 0F0BDC0 back to 15,777,216.
Dim negativeNumber As BigInteger = -1000000
Dim positiveNumber As BigInteger = 15777216

Dim negativeHex As String = negativeNumber.ToString("X")
Dim positiveHex As string = positiveNumber.ToString("X")

Dim negativeNumber2, positiveNumber2 As BigInteger 
negativeNumber2 = BigInteger.Parse(negativeHex, 
                                   NumberStyles.HexNumber)
positiveNumber2 = BigInteger.Parse(positiveHex,
                                   NumberStyles.HexNumber)

Console.WriteLine("Converted {0:N0} to {1} back to {2:N0}.", 
                   negativeNumber, negativeHex, negativeNumber2)                                         
Console.WriteLine("Converted {0:N0} to {1} back to {2:N0}.", 
                   positiveNumber, positiveHex, positiveNumber2)                                         
' The example displays the following output:
'       Converted -1,000,000 to F0BDC0 back to -1,000,000.
'       Converted 15,777,216 to 0F0BDC0 back to 15,777,216.

Namun, string heksadesimal yang dibuat dengan memanggil metode ToString dari jenis integral lainnya atau kelebihan beban metode ToString yang menyertakan parameter toBase tidak menunjukkan tanda nilai atau jenis data sumber tempat string heksadesimal diturunkan. Berhasil membuat instans nilai BigInteger dari string seperti itu memerlukan beberapa logika tambahan. Contoh berikut memberikan satu kemungkinan implementasi.

using System;
using System.Globalization;
using System.Numerics;

public struct HexValue
{
    public int Sign;
    public string Value;
}

public class ByteHexExample2
{
    public static void Main()
    {
        uint positiveNumber = 4039543321;
        int negativeNumber = -255423975;

        // Convert the numbers to hex strings.
        HexValue hexValue1, hexValue2;
        hexValue1.Value = positiveNumber.ToString("X");
        hexValue1.Sign = Math.Sign(positiveNumber);

        hexValue2.Value = Convert.ToString(negativeNumber, 16);
        hexValue2.Sign = Math.Sign(negativeNumber);

        // Round-trip the hexadecimal values to BigInteger values.
        string hexString;
        BigInteger positiveBigInt, negativeBigInt;

        hexString = (hexValue1.Sign == 1 ? "0" : "") + hexValue1.Value;
        positiveBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber);
        Console.WriteLine($"Converted {positiveNumber} to {hexValue1.Value} and back to {positiveBigInt}.");

        hexString = (hexValue2.Sign == 1 ? "0" : "") + hexValue2.Value;
        negativeBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber);
        Console.WriteLine($"Converted {negativeNumber} to {hexValue2.Value} and back to {negativeBigInt}.");
    }
}
// The example displays the following output:
//       Converted 4039543321 to F0C68A19 and back to 4039543321.
//       Converted -255423975 to f0c68a19 and back to -255423975.
Imports System.Globalization
Imports System.Numerics

Public Structure HexValue
    Public Sign As Integer
    Public Value As String
End Structure

Module Example2
    Public Sub Main()
        Dim positiveNumber As UInteger = 4039543321
        Dim negativeNumber As Integer = -255423975

        ' Convert the numbers to hex strings.
        Dim hexValue1, hexValue2 As HexValue
        hexValue1.Value = positiveNumber.ToString("X")
        hexValue1.Sign = Math.Sign(positiveNumber)

        hexValue2.Value = Convert.ToString(negativeNumber, 16)
        hexValue2.Sign = Math.Sign(negativeNumber)

        ' Round-trip the hexadecimal values to BigInteger values.
        Dim hexString As String
        Dim positiveBigInt, negativeBigInt As BigInteger

        hexString = CStr(IIf(hexValue1.Sign = 1, "0", "")) + hexValue1.Value
        positiveBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber)
        Console.WriteLine("Converted {0} to {1} and back to {2}.",
                        positiveNumber, hexValue1.Value, positiveBigInt)

        hexString = CStr(IIf(hexValue2.Sign = 1, "0", "")) + hexValue2.Value
        negativeBigInt = BigInteger.Parse(hexString, NumberStyles.HexNumber)
        Console.WriteLine("Converted {0} to {1} and back to {2}.",
                        negativeNumber, hexValue2.Value, negativeBigInt)

    End Sub
End Module
' The example displays the following output:
'       Converted 4039543321 to F0C68A19 and back to 4039543321.
'       Converted -255423975 to f0c68a19 and back to -255423975.

Konstruktor

Nama Deskripsi
BigInteger(Byte[])

Menginisialisasi instans BigInteger baru struktur menggunakan nilai dalam array byte.

BigInteger(Decimal)

Menginisialisasi instans BigInteger baru struktur menggunakan Decimal nilai.

BigInteger(Double)

Menginisialisasi instans BigInteger baru struktur menggunakan nilai floating-point presisi ganda.

BigInteger(Int32)

Menginisialisasi instans BigInteger baru struktur menggunakan nilai bilangan bulat bertanda tangan 32-bit.

BigInteger(Int64)

Menginisialisasi instans BigInteger baru struktur menggunakan nilai bilangan bulat bertanda tangan 64-bit.

BigInteger(ReadOnlySpan<Byte>, Boolean, Boolean)

Menginisialisasi instans BigInteger baru struktur menggunakan nilai dalam rentang byte baca-saja, dan secara opsional menunjukkan pengodean penandatanganan dan urutan byte endianness.

BigInteger(Single)

Menginisialisasi instans BigInteger baru struktur menggunakan nilai floating-point presisi tunggal.

BigInteger(UInt32)

Menginisialisasi instans BigInteger baru struktur menggunakan nilai bilangan bulat 32-bit yang tidak ditandatangani.

BigInteger(UInt64)

Menginisialisasi instans BigInteger baru struktur dengan nilai bilangan bulat 64-bit yang tidak ditandatangani.

Properti

Nama Deskripsi
IsEven

Menunjukkan apakah nilai objek saat ini BigInteger adalah angka genap.

IsOne

Menunjukkan apakah nilai objek saat ini BigInteger adalah One.

IsPowerOfTwo

Menunjukkan apakah nilai objek saat ini BigInteger adalah kekuatan dua.

IsZero

Menunjukkan apakah nilai objek saat ini BigInteger adalah Zero.

MinusOne

Mendapatkan nilai yang menunjukkan angka negatif satu (-1).

One

Mendapatkan nilai yang mewakili angka satu (1).

Sign

Mendapatkan angka yang menunjukkan tanda (negatif, positif, atau nol) dari objek saat ini BigInteger .

Zero

Mendapatkan nilai yang menunjukkan angka 0 (nol).

Metode

Nama Deskripsi
Abs(BigInteger)

Mendapatkan nilai BigInteger absolut objek.

Add(BigInteger, BigInteger)

Menambahkan dua BigInteger nilai dan mengembalikan hasilnya.

Clamp(BigInteger, BigInteger, BigInteger)

Menjepit nilai ke nilai minimum dan maksimum inklusif.

Compare(BigInteger, BigInteger)

Membandingkan dua BigInteger nilai dan mengembalikan bilangan bulat yang menunjukkan apakah nilai pertama kurang dari, sama dengan, atau lebih besar dari nilai kedua.

CompareTo(BigInteger)

Membandingkan instans ini dengan detik BigInteger dan mengembalikan bilangan bulat yang menunjukkan apakah nilai instans ini kurang dari, sama dengan, atau lebih besar dari nilai objek yang ditentukan.

CompareTo(Int64)

Membandingkan instans ini dengan bilangan bulat 64-bit yang ditandatangani dan mengembalikan bilangan bulat yang menunjukkan apakah nilai instans ini kurang dari, sama dengan, atau lebih besar dari nilai bilangan bulat 64-bit yang ditandatangani.

CompareTo(Object)

Membandingkan instans ini dengan objek tertentu dan mengembalikan bilangan bulat yang menunjukkan apakah nilai instans ini kurang dari, sama dengan, atau lebih besar dari nilai objek yang ditentukan.

CompareTo(UInt64)

Membandingkan instans ini dengan bilangan bulat 64-bit yang tidak ditandatangani dan mengembalikan bilangan bulat yang menunjukkan apakah nilai instans ini kurang dari, sama dengan, atau lebih besar dari nilai bilangan bulat 64-bit yang tidak ditandatangani.

CopySign(BigInteger, BigInteger)

Menyalin tanda nilai ke tanda nilai lain.

CreateChecked<TOther>(TOther)

Membuat instans jenis saat ini dari nilai, melemparkan pengecualian luapan untuk nilai apa pun yang berada di luar rentang yang dapat diwakili dari jenis saat ini.

CreateSaturating<TOther>(TOther)

Membuat instans jenis saat ini dari nilai, menjenuhkan nilai apa pun yang berada di luar rentang yang dapat diwakili dari jenis saat ini.

CreateTruncating<TOther>(TOther)

Membuat instans jenis saat ini dari nilai, memotong nilai apa pun yang berada di luar rentang yang dapat diwakili dari jenis saat ini.

Divide(BigInteger, BigInteger)

Membagi satu BigInteger nilai dengan nilai lainnya dan mengembalikan hasilnya.

DivRem(BigInteger, BigInteger, BigInteger)

Membagi satu BigInteger nilai dengan nilai lainnya, mengembalikan hasilnya, dan mengembalikan sisanya dalam parameter output.

DivRem(BigInteger, BigInteger)

Menghitung kuota dan sisa dari dua nilai.

Equals(BigInteger)

Mengembalikan nilai yang menunjukkan apakah instans saat ini dan objek tertentu BigInteger memiliki nilai yang sama.

Equals(Int64)

Mengembalikan nilai yang menunjukkan apakah instans saat ini dan bilangan bulat 64-bit yang ditandatangani memiliki nilai yang sama.

Equals(Object)

Mengembalikan nilai yang menunjukkan apakah instans saat ini dan objek tertentu memiliki nilai yang sama.

Equals(UInt64)

Mengembalikan nilai yang menunjukkan apakah instans saat ini dan bilangan bulat 64-bit yang tidak ditandatangani memiliki nilai yang sama.

GetBitLength()

Mendapatkan jumlah bit yang diperlukan untuk representasi pelengkap dua terpendek dari instans saat ini tanpa bit tanda.

GetByteCount(Boolean)

Mendapatkan jumlah byte yang akan dihasilkan oleh ToByteArray(Boolean, Boolean) dan TryWriteBytes(Span<Byte>, Int32, Boolean, Boolean).

GetHashCode()

Mengembalikan kode hash untuk objek saat ini BigInteger .

GreatestCommonDivisor(BigInteger, BigInteger)

Menemukan pembavisor umum terbesar dari dua BigInteger nilai.

IsEvenInteger(BigInteger)

Menentukan apakah nilai mewakili angka integral genap.

IsNegative(BigInteger)

Menentukan apakah nilai negatif.

IsOddInteger(BigInteger)

Menentukan apakah nilai mewakili angka integral ganjil.

IsPositive(BigInteger)

Menentukan apakah nilai positif.

IsPow2(BigInteger)

Menentukan apakah nilai adalah kekuatan dua.

LeadingZeroCount(BigInteger)

Menghitung jumlah nol di depan dalam sebuah nilai.

Log(BigInteger, Double)

Mengembalikan logaritma dari angka tertentu dalam basis tertentu.

Log(BigInteger)

Mengembalikan logaritma alami (dasar e) dari angka tertentu.

Log10(BigInteger)

Mengembalikan logaritma basis 10 dari angka tertentu.

Log2(BigInteger)

Menghitung log2 dari nilai.

Max(BigInteger, BigInteger)

Mengembalikan nilai yang lebih besar dari dua BigInteger nilai.

MaxMagnitude(BigInteger, BigInteger)

Membandingkan dua nilai dengan komputasi yang lebih besar.

Min(BigInteger, BigInteger)

Mengembalikan nilai yang lebih kecil dari dua BigInteger nilai.

MinMagnitude(BigInteger, BigInteger)

Membandingkan dua nilai dengan komputasi yang lebih rendah.

ModPow(BigInteger, BigInteger, BigInteger)

Melakukan pembagian modulus pada angka yang dinaikkan ke kekuatan angka lain.

Multiply(BigInteger, BigInteger)

Mengembalikan produk dari dua BigInteger nilai.

Negate(BigInteger)

Meniadakan nilai yang ditentukan BigInteger .

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Mengurai rentang karakter menjadi nilai.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Mengonversi representasi angka, yang terkandung dalam rentang karakter baca-saja yang ditentukan, dalam gaya yang ditentukan ke BigInteger yang setara.

Parse(String, IFormatProvider)

Mengonversi representasi string dari angka dalam format khusus budaya tertentu ke BigInteger yang setara.

Parse(String, NumberStyles, IFormatProvider)

Mengonversi representasi string dari angka dalam gaya tertentu dan format khusus budaya menjadi BigInteger setara.

Parse(String, NumberStyles)

Mengonversi representasi string dari angka dalam gaya tertentu ke BigInteger yang setara.

Parse(String)

Mengonversi representasi string dari angka menjadi BigInteger setara.

PopCount(BigInteger)

Menghitung jumlah bit yang diatur dalam nilai.

Pow(BigInteger, Int32)

BigInteger Menaikkan nilai ke kekuatan nilai tertentu.

Remainder(BigInteger, BigInteger)

Melakukan pembagian bilangan bulat pada dua BigInteger nilai dan mengembalikan sisanya.

RotateLeft(BigInteger, Int32)

Memutar nilai yang ditinggalkan oleh jumlah tertentu.

RotateRight(BigInteger, Int32)

Memutar nilai tepat dengan jumlah tertentu.

Subtract(BigInteger, BigInteger)

Mengurangi satu BigInteger nilai dari nilai lain dan mengembalikan hasilnya.

ToByteArray()

BigInteger Mengonversi nilai menjadi array byte.

ToByteArray(Boolean, Boolean)

Mengembalikan nilai ini BigInteger sebagai array byte menggunakan jumlah byte sekecil mungkin. Jika nilainya nol, mengembalikan array dari satu byte yang elemennya 0x00.

ToString()

Mengonversi nilai numerik objek BigInteger saat ini ke representasi string yang setara.

ToString(IFormatProvider)

Mengonversi nilai numerik objek BigInteger saat ini ke representasi string yang setara dengan menggunakan informasi pemformatan khusus budaya yang ditentukan.

ToString(String, IFormatProvider)

Mengonversi nilai numerik objek BigInteger saat ini ke representasi string yang setara dengan menggunakan format yang ditentukan dan informasi format khusus budaya.

ToString(String)

Mengonversi nilai numerik objek BigInteger saat ini ke representasi string yang setara dengan menggunakan format yang ditentukan.

TrailingZeroCount(BigInteger)

Menghitung jumlah nol berikutnya dalam sebuah nilai.

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Memformat instans bilangan bulat besar ini ke dalam rentang karakter.

TryParse(ReadOnlySpan<Byte>, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

TryParse(ReadOnlySpan<Char>, BigInteger)

Mencoba mengonversi representasi angka yang terkandung dalam rentang karakter baca-saja yang ditentukan, setara BigInteger , dan mengembalikan nilai yang menunjukkan apakah konversi berhasil.

TryParse(ReadOnlySpan<Char>, IFormatProvider, BigInteger)

Mencoba mengurai rentang karakter menjadi nilai.

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, BigInteger)

Mencoba mengonversi representasi string dari angka ke BigInteger yang setara, dan mengembalikan nilai yang menunjukkan apakah konversi berhasil.

TryParse(String, BigInteger)

Mencoba mengonversi representasi string dari angka ke BigInteger yang setara, dan mengembalikan nilai yang menunjukkan apakah konversi berhasil.

TryParse(String, IFormatProvider, BigInteger)

Mencoba mengurai string ke dalam nilai.

TryParse(String, NumberStyles, IFormatProvider, BigInteger)

Mencoba mengonversi representasi string dari angka dalam gaya tertentu dan format khusus budaya menjadi BigInteger setara, dan mengembalikan nilai yang menunjukkan apakah konversi berhasil.

TryWriteBytes(Span<Byte>, Int32, Boolean, Boolean)

Menyalin nilai ini BigInteger sebagai byte pelengkap dua ujung kecil, menggunakan jumlah byte sekecil mungkin. Jika nilainya nol, menghasilkan satu byte yang elemennya 0x00.

Operator

Nama Deskripsi
Addition(BigInteger, BigInteger)

Menambahkan nilai dua objek yang ditentukan BigInteger .

BitwiseAnd(BigInteger, BigInteger)

Melakukan operasi bitwise And pada dua BigInteger nilai.

BitwiseOr(BigInteger, BigInteger)

Melakukan operasi bitwise Or pada dua BigInteger nilai.

Decrement(BigInteger)

BigInteger Mengurangi nilai sebesar 1.

Division(BigInteger, BigInteger)

Membagi nilai tertentu BigInteger dengan nilai lain yang ditentukan BigInteger dengan menggunakan pembagian bilangan bulat.

Equality(BigInteger, BigInteger)

Mengembalikan nilai yang menunjukkan apakah nilai dua BigInteger objek sama.

Equality(BigInteger, Int64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai dan nilai bilangan bulat panjang yang ditandatangani sama.

Equality(BigInteger, UInt64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai dan nilai bilangan bulat panjang yang tidak ditandatangani sama.

Equality(Int64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah nilai bilangan bulat panjang yang ditandatangani dan BigInteger nilai sama.

Equality(UInt64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah nilai bilangan bulat panjang yang tidak ditandatangani dan BigInteger nilai sama.

ExclusiveOr(BigInteger, BigInteger)

Melakukan operasi eksklusif Or bitwise (XOr) pada dua BigInteger nilai.

Explicit(BFloat16 to BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

Explicit(BigInteger to BFloat16)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

Explicit(BigInteger to Byte)

Menentukan konversi BigInteger eksplisit objek ke nilai byte yang tidak ditandatangani.

Explicit(BigInteger to Char)

Secara eksplisit mengonversi bilangan bulat besar menjadi Char nilai.

Explicit(BigInteger to Decimal)

Menentukan konversi BigInteger eksplisit objek ke Decimal nilai.

Explicit(BigInteger to Double)

Menentukan konversi BigInteger eksplisit objek ke Double nilai.

Explicit(BigInteger to Half)

Secara eksplisit mengonversi bilangan bulat besar menjadi Half nilai.

Explicit(BigInteger to Int128)

Secara eksplisit mengonversi bilangan bulat besar menjadi Int128 nilai.

Explicit(BigInteger to Int16)

Menentukan konversi BigInteger eksplisit objek ke nilai bilangan bulat bertanda 16-bit.

Explicit(BigInteger to Int32)

Menentukan konversi BigInteger eksplisit objek ke nilai bilangan bulat bertanda tangan 32-bit.

Explicit(BigInteger to Int64)

Menentukan konversi BigInteger eksplisit objek ke nilai bilangan bulat bertanda tangan 64-bit.

Explicit(BigInteger to IntPtr)

Secara eksplisit mengonversi bilangan bulat besar menjadi IntPtr nilai.

Explicit(BigInteger to SByte)

Menentukan konversi BigInteger eksplisit objek ke nilai 8-bit yang ditandatangani.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Int16.

Explicit(BigInteger to Single)

Menentukan konversi BigInteger eksplisit objek ke nilai floating-point presisi tunggal.

Explicit(BigInteger to UInt128)

Secara eksplisit mengonversi bilangan bulat besar menjadi UInt128 nilai.

Explicit(BigInteger to UInt16)

Menentukan konversi BigInteger eksplisit objek ke nilai bilangan bulat 16-bit yang tidak ditandatangani.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Int32.

Explicit(BigInteger to UInt32)

Menentukan konversi BigInteger eksplisit objek ke nilai bilangan bulat 32-bit yang tidak ditandatangani.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Int64.

Explicit(BigInteger to UInt64)

Menentukan konversi BigInteger eksplisit objek ke nilai bilangan bulat 64-bit yang tidak ditandatangani.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Double.

Explicit(BigInteger to UIntPtr)

Secara eksplisit mengonversi bilangan bulat besar menjadi UIntPtr nilai.

Explicit(Complex to BigInteger)

Secara eksplisit mengonversi nilai menjadi Complex bilangan bulat besar.

Explicit(Decimal to BigInteger)

Menentukan konversi Decimal eksplisit objek ke BigInteger nilai.

Explicit(Double to BigInteger)

Menentukan konversi eksplisit nilai Double menjadi BigInteger nilai.

Explicit(Half to BigInteger)

Secara eksplisit mengonversi nilai menjadi Half bilangan bulat besar.

Explicit(Single to BigInteger)

Menentukan konversi eksplisit nilai Single menjadi BigInteger nilai.

GreaterThan(BigInteger, BigInteger)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari nilai lain BigInteger .

GreaterThan(BigInteger, Int64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari nilai bilangan bulat bertanda tangan 64-bit.

GreaterThan(BigInteger, UInt64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari bilangan bulat yang tidak ditandatangani 64-bit.

GreaterThan(Int64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat bertanda tangan 64-bit lebih besar dari BigInteger nilai.

GreaterThan(UInt64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari bilangan bulat yang tidak ditandatangani 64-bit.

GreaterThanOrEqual(BigInteger, BigInteger)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari atau sama dengan nilai lain BigInteger .

GreaterThanOrEqual(BigInteger, Int64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari atau sama dengan nilai bilangan bulat bertanda 64-bit.

GreaterThanOrEqual(BigInteger, UInt64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai lebih besar dari atau sama dengan nilai bilangan bulat yang tidak ditandatangani 64-bit.

GreaterThanOrEqual(Int64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat bertanda tangan 64-bit lebih besar dari atau sama dengan BigInteger nilai.

GreaterThanOrEqual(UInt64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat yang tidak ditandatangani 64-bit lebih besar dari atau sama dengan BigInteger nilai.

Implicit(Byte to BigInteger)

Menentukan konversi implisit byte yang tidak ditandatangani ke BigInteger nilai.

Implicit(Char to BigInteger)

Secara implisit mengonversi nilai menjadi Char bilangan bulat besar.

Implicit(Int128 to BigInteger)

Secara implisit mengonversi nilai menjadi Int128 bilangan bulat besar.

Implicit(Int16 to BigInteger)

Menentukan konversi implisit bilangan bulat 16-bit yang ditandatangani ke BigInteger nilai.

Implicit(Int32 to BigInteger)

Menentukan konversi implisit bilangan bulat 32-bit yang ditandatangani ke BigInteger nilai.

Implicit(Int64 to BigInteger)

Menentukan konversi implisit bilangan bulat 64-bit yang ditandatangani ke BigInteger nilai.

Implicit(IntPtr to BigInteger)

Secara implisit mengonversi nilai menjadi IntPtr bilangan bulat besar.

Implicit(SByte to BigInteger)

Menentukan konversi implisit bilangan bulat bertanda tangan 8-bit ke BigInteger nilai.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah BigInteger(Int32).

Implicit(UInt128 to BigInteger)

Secara implisit mengonversi nilai menjadi UInt128 bilangan bulat besar.

Implicit(UInt16 to BigInteger)

Menentukan konversi implisit bilangan bulat yang tidak ditandatangani 16-bit ke BigInteger nilai.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Implicit(Int32 to BigInteger).

Implicit(UInt32 to BigInteger)

Menentukan konversi implisit bilangan bulat yang tidak ditandatangani 32-bit ke BigInteger nilai.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Implicit(Int64 to BigInteger).

Implicit(UInt64 to BigInteger)

Menentukan konversi implisit bilangan bulat yang tidak ditandatangani 64-bit ke BigInteger nilai.

API ini bukan kompatibel CLS. Alternatif yang sesuai adalah Double.

Implicit(UIntPtr to BigInteger)

Secara implisit mengonversi nilai menjadi UIntPtr bilangan bulat besar.

Increment(BigInteger)

Menaikkan BigInteger nilai sebesar 1.

Inequality(BigInteger, BigInteger)

Mengembalikan nilai yang menunjukkan apakah dua BigInteger objek memiliki nilai yang berbeda.

Inequality(BigInteger, Int64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai dan bilangan bulat bertanda tangan 64-bit tidak sama.

Inequality(BigInteger, UInt64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai dan bilangan bulat yang tidak ditandatangani 64-bit tidak sama.

Inequality(Int64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat bertanda tangan 64-bit dan BigInteger nilai tidak sama.

Inequality(UInt64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat yang tidak ditandatangani 64-bit dan BigInteger nilai tidak sama.

LeftShift(BigInteger, Int32)

Mengalihkan BigInteger nilai jumlah bit yang ditentukan ke kiri.

LessThan(BigInteger, BigInteger)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai kurang dari nilai lain BigInteger .

LessThan(BigInteger, Int64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai kurang dari bilangan bulat bertanda tangan 64-bit.

LessThan(BigInteger, UInt64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai kurang dari bilangan bulat yang tidak ditandatangani 64-bit.

LessThan(Int64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat bertanda tangan 64-bit kurang dari BigInteger nilai.

LessThan(UInt64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat yang tidak ditandatangani 64-bit kurang dari BigInteger nilai.

LessThanOrEqual(BigInteger, BigInteger)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai kurang dari atau sama dengan nilai lain BigInteger .

LessThanOrEqual(BigInteger, Int64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai kurang dari atau sama dengan bilangan bulat bertanda tangan 64-bit.

LessThanOrEqual(BigInteger, UInt64)

Mengembalikan nilai yang menunjukkan apakah BigInteger nilai kurang dari atau sama dengan bilangan bulat yang tidak ditandatangani 64-bit.

LessThanOrEqual(Int64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat bertanda tangan 64-bit kurang dari atau sama dengan BigInteger nilai.

LessThanOrEqual(UInt64, BigInteger)

Mengembalikan nilai yang menunjukkan apakah bilangan bulat yang tidak ditandatangani 64-bit kurang dari atau sama dengan BigInteger nilai.

Modulus(BigInteger, BigInteger)

Mengembalikan sisa hasil dari pembagian dengan dua nilai yang ditentukan BigInteger .

Multiply(BigInteger, BigInteger)

Mengalikan dua nilai yang ditentukan BigInteger .

OnesComplement(BigInteger)

Mengembalikan pelengkap BigInteger nilai bitwise.

RightShift(BigInteger, Int32)

Mengalihkan BigInteger nilai jumlah bit yang ditentukan ke kanan.

Subtraction(BigInteger, BigInteger)

Mengurangi BigInteger nilai dari nilai lain BigInteger .

UnaryNegation(BigInteger)

Meniadakan nilai BigInteger tertentu.

UnaryPlus(BigInteger)

Mengembalikan nilai BigInteger operand. (Tanda operand tidak berubah.)

UnsignedRightShift(BigInteger, Int32)

Menggeser nilai ke kanan dengan jumlah tertentu.

Implementasi Antarmuka Eksplisit

Nama Deskripsi
IAdditiveIdentity<BigInteger,BigInteger>.AdditiveIdentity

Mendapatkan identitas aditif dari jenis saat ini.

IBinaryInteger<BigInteger>.GetByteCount()

Mendapatkan jumlah byte yang akan ditulis sebagai bagian TryWriteLittleEndian(Span<Byte>, Int32)dari .

IBinaryInteger<BigInteger>.GetShortestBitLength()

Mendapatkan panjang, dalam bit, dari representasi pelengkap dua terpendek dari nilai saat ini.

IBinaryInteger<BigInteger>.Log10(BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

IBinaryInteger<BigInteger>.TryReadBigEndian(ReadOnlySpan<Byte>, Boolean, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

IBinaryInteger<BigInteger>.TryReadLittleEndian(ReadOnlySpan<Byte>, Boolean, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

IBinaryInteger<BigInteger>.TryWriteBigEndian(Span<Byte>, Int32)

Mencoba menulis nilai saat ini, dalam format big-endian, ke rentang tertentu.

IBinaryInteger<BigInteger>.TryWriteLittleEndian(Span<Byte>, Int32)

Mencoba menulis nilai saat ini, dalam format little-endian, ke rentang tertentu.

IBinaryNumber<BigInteger>.AllBitsSet

Mendapatkan instans jenis biner tempat semua bit diatur.

IComparable.CompareTo(Object)

Membandingkan instans ini dengan objek tertentu dan mengembalikan bilangan bulat yang menunjukkan apakah nilai instans ini kurang dari, sama dengan, atau lebih besar dari nilai objek yang ditentukan.

IMultiplicativeIdentity<BigInteger,BigInteger>.MultiplicativeIdentity

Mendapatkan identitas multiplikatif dari jenis saat ini.

INumber<BigInteger>.MaxNumber(BigInteger, BigInteger)

Membandingkan dua nilai dengan komputasi yang lebih besar dan mengembalikan nilai lain jika satu input adalah NaN.

INumber<BigInteger>.MinNumber(BigInteger, BigInteger)

Membandingkan dua nilai dengan komputasi yang lebih kecil dan mengembalikan nilai lain jika satu input adalah NaN.

INumber<BigInteger>.Sign(BigInteger)

Menghitung tanda nilai.

INumberBase<BigInteger>.IsCanonical(BigInteger)

Menentukan apakah nilai berada dalam representasi kanonisnya.

INumberBase<BigInteger>.IsComplexNumber(BigInteger)

Menentukan apakah nilai mewakili bilangan kompleks.

INumberBase<BigInteger>.IsFinite(BigInteger)

Menentukan apakah nilai terbatas.

INumberBase<BigInteger>.IsImaginaryNumber(BigInteger)

Menentukan apakah nilai mewakili angka imajiner murni.

INumberBase<BigInteger>.IsInfinity(BigInteger)

Menentukan apakah nilai tidak terbatas.

INumberBase<BigInteger>.IsInteger(BigInteger)

Menentukan apakah nilai mewakili angka integral.

INumberBase<BigInteger>.IsNaN(BigInteger)

Menentukan apakah nilainya adalah NaN.

INumberBase<BigInteger>.IsNegativeInfinity(BigInteger)

Menentukan apakah nilai adalah tak terbatas negatif.

INumberBase<BigInteger>.IsNormal(BigInteger)

Menentukan apakah nilai normal.

INumberBase<BigInteger>.IsPositiveInfinity(BigInteger)

Menentukan apakah nilai adalah tak terbatas positif.

INumberBase<BigInteger>.IsRealNumber(BigInteger)

Menentukan apakah nilai mewakili angka riil.

INumberBase<BigInteger>.IsSubnormal(BigInteger)

Menentukan apakah nilai adalah subnormal.

INumberBase<BigInteger>.IsZero(BigInteger)

Menentukan apakah nilai adalah nol.

INumberBase<BigInteger>.MaxMagnitudeNumber(BigInteger, BigInteger)

Membandingkan dua nilai dengan komputasi yang memiliki besaran lebih besar dan mengembalikan nilai lainnya jika satu input adalah NaN.

INumberBase<BigInteger>.MinMagnitudeNumber(BigInteger, BigInteger)

Membandingkan dua nilai dengan komputasi yang memiliki besaran lebih kecil dan mengembalikan nilai lain jika satu input adalah NaN.

INumberBase<BigInteger>.MultiplyAddEstimate(BigInteger, BigInteger, BigInteger)

Menghitung perkiraan (left * right) + . addend

INumberBase<BigInteger>.Radix

Mendapatkan radix, atau basis, untuk tipe tersebut.

INumberBase<BigInteger>.TryConvertFromChecked<TOther>(TOther, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

INumberBase<BigInteger>.TryConvertFromSaturating<TOther>(TOther, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

INumberBase<BigInteger>.TryConvertFromTruncating<TOther>(TOther, BigInteger)

Mewakili bilangan bulat bertanda tangan yang sangat besar.

INumberBase<BigInteger>.TryConvertToChecked<TOther>(BigInteger, TOther)

Mencoba mengonversi instans jenis saat ini ke jenis lain, melemparkan pengecualian luapan untuk nilai apa pun yang berada di luar rentang yang dapat diwakili dari jenis saat ini.

INumberBase<BigInteger>.TryConvertToSaturating<TOther>(BigInteger, TOther)

Mencoba mengonversi instans jenis saat ini ke jenis lain, menjenuhkan nilai apa pun yang berada di luar rentang yang dapat diwakili dari jenis saat ini.

INumberBase<BigInteger>.TryConvertToTruncating<TOther>(BigInteger, TOther)

Mencoba mengonversi instans jenis saat ini ke jenis lain, memotong nilai apa pun yang berada di luar rentang yang dapat diwakili dari jenis saat ini.

ISignedNumber<BigInteger>.NegativeOne

Mendapatkan nilai -1 untuk jenis tersebut.

Berlaku untuk