BigInteger Struct

Definizione

Rappresenta un intero con segno di dimensioni arbitrarie.

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)
Ereditarietà
BigInteger
Attributi
Implementazioni
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>

Commenti

Il tipo BigInteger è un tipo non modificabile che rappresenta un intero arbitrariamente grande il cui valore in teoria non ha limiti superiori o inferiori. I membri del tipo BigInteger sono strettamente paralleli a quelli di altri tipi integrali (i tipi Byte, Int16, Int32, Int64, SByte, UInt16, UInt32e UInt64). Questo tipo differisce dagli altri tipi integrali in .NET, che hanno un intervallo indicato dalle relative proprietà MinValue e MaxValue.

Note

Poiché il tipo BigInteger non è modificabile (vedere Mutabilità) e poiché non dispone di limiti superiori o inferiori, è possibile generare un OutOfMemoryException per qualsiasi operazione che causa un aumento eccessivo di un valore di BigInteger.

Creare un'istanza di un oggetto BigInteger

È possibile creare un'istanza di un oggetto BigInteger in diversi modi:

  • È possibile usare la parola chiave new e specificare qualsiasi valore integrale o a virgola mobile come parametro per il costruttore BigInteger. I valori a virgola mobile sono troncati prima che vengano assegnati a BigInteger. Nell'esempio seguente viene illustrato come usare la parola chiave new istanziando valori 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
    
  • È possibile dichiarare una variabile BigInteger e assegnarla un valore esattamente come qualsiasi tipo numerico, purché tale valore sia un tipo integrale. Nell'esempio seguente viene usata l'assegnazione per creare un valore BigInteger da un 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
    
  • È possibile assegnare un valore decimale o a virgola mobile a un oggetto BigInteger se si esegue il cast del valore o lo si converte per primo. Nell'esempio seguente viene eseguito il cast esplicito (in C#) o la conversione (in Visual Basic) di un valore Double e di un valore Decimal in un 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
    

Questi metodi consentono di creare un'istanza di un oggetto BigInteger il cui valore è compreso nell'intervallo di uno dei tipi numerici esistenti. È possibile creare un'istanza di un oggetto BigInteger il cui valore può superare l'intervallo dei tipi numerici esistenti in uno dei tre modi seguenti:

  • È possibile usare la parola chiave new e fornire una matrice di byte di qualsiasi dimensione al costruttore BigInteger.BigInteger. Per esempio:

    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).
    
  • È possibile chiamare i metodi Parse o TryParse per convertire la rappresentazione di stringa di un numero in un BigInteger. Per esempio:

    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
    
  • È possibile chiamare un metodo static (Shared in Visual Basic) BigInteger che esegue un'operazione su un'espressione numerica e restituisce un risultato BigInteger calcolato. L'esempio seguente esegue questa operazione cubindo UInt64.MaxValue e assegnando il risultato a un 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
    

Il valore non inizializzato di un BigInteger è Zero.

Eseguire operazioni sui valori BigInteger

È possibile usare un'istanza di BigInteger come si userebbe qualsiasi altro tipo integrale. BigInteger sovraccarica gli operatori numerici standard per consentire di eseguire operazioni matematiche di base, ad esempio addizione, sottrazione, divisione, moltiplicazione e negazione unaria. È anche possibile usare gli operatori numerici standard per confrontare due valori BigInteger tra loro. Analogamente agli altri tipi integrali, BigInteger supporta anche gli operatori bit per bit And, Or, XOr, spostamento sinistro e spostamento a destra. Per i linguaggi che non supportano operatori personalizzati, la struttura BigInteger fornisce anche metodi equivalenti per l'esecuzione di operazioni matematiche. Sono inclusi Add, Divide, Multiply, Negate, Subtracte molti altri.

Molti membri della struttura BigInteger corrispondono direttamente ai membri degli altri tipi integrali. Inoltre, BigInteger aggiunge membri come i seguenti:

  • Sign, che restituisce un valore che indica il segno di un valore BigInteger.

  • Abs, che restituisce il valore assoluto di un valore BigInteger.

  • DivRem, che restituisce sia il quoziente che il resto di un'operazione di divisione.

  • GreatestCommonDivisor, che restituisce il divisore comune più grande di due valori di BigInteger.

Molti di questi membri aggiuntivi corrispondono ai membri della classe Math, che fornisce la funzionalità per lavorare con i tipi numerici primitivi.

Modificabilità

Nell'esempio seguente viene creata un'istanza di un oggetto BigInteger e quindi ne viene incrementato il valore di uno.

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)

Anche se questo esempio sembra modificare il valore dell'oggetto esistente, questo non è il caso. BigInteger oggetti non sono modificabili, ovvero internamente, Common Language Runtime crea effettivamente un nuovo oggetto BigInteger e lo assegna un valore maggiore del valore precedente. Questo nuovo oggetto viene quindi restituito al chiamante.

Note

Anche gli altri tipi numerici in .NET sono non modificabili. Tuttavia, poiché il tipo BigInteger non ha limiti superiori o inferiori, i relativi valori possono crescere estremamente grandi e avere un impatto misurabile sulle prestazioni.

Anche se questo processo è trasparente per il chiamante, comporta una riduzione delle prestazioni. In alcuni casi, soprattutto quando le operazioni ripetute vengono eseguite in un ciclo su valori di BigInteger molto grandi, la riduzione delle prestazioni può essere significativa. Nell'esempio seguente, ad esempio, un'operazione viene eseguita ripetutamente fino a un milione di volte e un valore BigInteger viene incrementato di uno ogni volta che l'operazione ha esito positivo.

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

In questo caso, è possibile migliorare le prestazioni eseguendo tutte le assegnazioni intermedie a una variabile Int32. Il valore finale della variabile può quindi essere assegnato all'oggetto BigInteger all'uscita del ciclo. Di seguito ne viene illustrato un esempio.

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

Matrici di byte e stringhe esadecimali

Se si converte BigInteger valori in matrici di byte o se si converte le matrici di byte in valori BigInteger, è necessario considerare l'ordine dei byte. La struttura BigInteger prevede che i singoli byte in una matrice di byte vengano visualizzati in ordine little-endian, ovvero i byte in ordine inferiore del valore precedono i byte di ordine superiore. È possibile eseguire il round trip di un valore BigInteger chiamando il metodo ToByteArray e quindi passando la matrice di byte risultante al costruttore BigInteger(Byte[]), come illustrato nell'esempio seguente.

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

Per creare un'istanza di un valore BigInteger da una matrice di byte che rappresenta un valore di un altro tipo integrale, è possibile passare il valore integrale al metodo BitConverter.GetBytes e quindi passare la matrice di byte risultante al costruttore BigInteger(Byte[]). Nell'esempio seguente viene creata un'istanza di un valore BigInteger da una matrice di byte che rappresenta un valore 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

La struttura BigInteger presuppone che i valori negativi vengano archiviati usando la rappresentazione di complemento di due. Poiché la struttura BigInteger rappresenta un valore numerico senza lunghezza fissa, il costruttore BigInteger(Byte[]) interpreta sempre il bit più significativo dell'ultimo byte nella matrice come bit di segno. Per impedire al costruttore BigInteger(Byte[]) di confondere la rappresentazione complementare di un valore negativo con il segno e la rappresentazione di grandezza di un valore positivo, i valori positivi in cui il bit più significativo dell'ultimo byte nella matrice di byte deve in genere essere impostato deve includere un byte aggiuntivo il cui valore è 0. Ad esempio, 0xC0 0xBD 0xF0 0xFF è la rappresentazione esadecimale in formato little-endian di -1.000.000 oppure di 4.293.967.296. Poiché il bit più significativo dell'ultimo byte in questa matrice è attivo, il valore della matrice di byte viene interpretato dal costruttore BigInteger(Byte[]) come -1.000.000. Per creare un'istanza di un BigInteger il cui valore è positivo, è necessario passare al costruttore una matrice di byte i cui elementi sono 0xC0 0xBD 0xF0 0xFF 0x00. Nel seguente esempio viene illustrato questo aspetto.

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

Le matrici di byte create dal metodo ToByteArray da valori positivi includono questo byte con valore zero aggiuntivo. Pertanto, la struttura BigInteger può eseguire correttamente un round-trip dei valori assegnandoli e quindi ripristinandoli dalle matrici di byte, come illustrato nell'esempio seguente.

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

Potrebbe tuttavia essere necessario aggiungere questo byte zero aggiuntivo alle matrici di byte create dinamicamente dallo sviluppatore o restituite da metodi che convertono numeri interi senza segno in matrici di byte , ad esempio BitConverter.GetBytes(UInt16), BitConverter.GetBytes(UInt32)e BitConverter.GetBytes(UInt64).

Quando si analizza una stringa esadecimale, i metodi BigInteger.Parse(String, NumberStyles) e BigInteger.Parse(String, NumberStyles, IFormatProvider) presuppongono che se viene impostato il bit più significativo del primo byte nella stringa o se la prima cifra esadecimale della stringa rappresenta i quattro bit inferiori di un valore di byte, il valore viene rappresentato usando la rappresentazione di complemento di due. Ad esempio, sia "FF01" che "F01" rappresentano il valore decimale -255. Per distinguere i positivi dai valori negativi, i valori positivi devono includere uno zero iniziale. Gli overload pertinenti del metodo ToString, quando viene passata loro la stringa di formato "X", aggiungono uno zero iniziale alla stringa esadecimale restituita per i valori positivi. In questo modo è possibile effettuare il round-trip dei valori BigInteger usando i metodi ToString e Parse, come illustrato nell'esempio seguente.

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.

Tuttavia, le stringhe esadecimali create chiamando i metodi ToString degli altri tipi integrali o gli overload del metodo ToString che includono un parametro toBase non indicano il segno del valore o del tipo di dati di origine da cui è stata derivata la stringa esadecimale. Per creare con successo un'istanza di un valore BigInteger da tale stringa, è necessaria una logica essenziale. Nell'esempio seguente viene fornita una possibile implementazione.

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.

Costruttori

Nome Descrizione
BigInteger(Byte[])

Inizializza una nuova istanza della BigInteger struttura utilizzando i valori in una matrice di byte.

BigInteger(Decimal)

Inizializza una nuova istanza della BigInteger struttura utilizzando un Decimal valore .

BigInteger(Double)

Inizializza una nuova istanza della BigInteger struttura utilizzando un valore a virgola mobile e precisione doppia.

BigInteger(Int32)

Inizializza una nuova istanza della BigInteger struttura utilizzando un valore intero con segno a 32 bit.

BigInteger(Int64)

Inizializza una nuova istanza della BigInteger struttura utilizzando un valore intero con segno a 64 bit.

BigInteger(ReadOnlySpan<Byte>, Boolean, Boolean)

Inizializza una nuova istanza della BigInteger struttura utilizzando i valori in un intervallo di byte di sola lettura e, facoltativamente, che indica la codifica della firma e l'ordine dei byte di endianness.

BigInteger(Single)

Inizializza una nuova istanza della BigInteger struttura utilizzando un valore a virgola mobile e precisione singola.

BigInteger(UInt32)

Inizializza una nuova istanza della BigInteger struttura utilizzando un valore intero senza segno a 32 bit.

BigInteger(UInt64)

Inizializza una nuova istanza della BigInteger struttura con un valore intero senza segno a 64 bit.

Proprietà

Nome Descrizione
IsEven

Indica se il valore dell'oggetto corrente BigInteger è un numero pari.

IsOne

Indica se il valore dell'oggetto corrente BigInteger è One.

IsPowerOfTwo

Indica se il valore dell'oggetto corrente BigInteger è una potenza di due.

IsZero

Indica se il valore dell'oggetto corrente BigInteger è Zero.

MinusOne

Ottiene un valore che rappresenta il numero negativo 1 (-1).

One

Ottiene un valore che rappresenta il numero uno (1).

Sign

Ottiene un numero che indica il segno (negativo, positivo o zero) dell'oggetto corrente BigInteger .

Zero

Ottiene un valore che rappresenta il numero 0 (zero).

Metodi

Nome Descrizione
Abs(BigInteger)

Ottiene il valore assoluto di un BigInteger oggetto .

Add(BigInteger, BigInteger)

Aggiunge due BigInteger valori e restituisce il risultato.

Clamp(BigInteger, BigInteger, BigInteger)

Blocca un valore a un valore minimo e massimo inclusivo.

Compare(BigInteger, BigInteger)

Confronta due BigInteger valori e restituisce un numero intero che indica se il primo valore è minore, uguale o maggiore del secondo valore.

CompareTo(BigInteger)

Confronta questa istanza con un secondo BigInteger e restituisce un numero intero che indica se il valore di questa istanza è minore, uguale o maggiore del valore dell'oggetto specificato.

CompareTo(Int64)

Confronta questa istanza con un intero con segno a 64 bit e restituisce un intero che indica se il valore di questa istanza è minore, uguale o maggiore del valore dell'intero con segno a 64 bit.

CompareTo(Object)

Confronta questa istanza con un oggetto specificato e restituisce un numero intero che indica se il valore di questa istanza è minore, uguale o maggiore del valore dell'oggetto specificato.

CompareTo(UInt64)

Confronta questa istanza con un intero senza segno a 64 bit e restituisce un intero che indica se il valore di questa istanza è minore, uguale o maggiore del valore dell'intero senza segno a 64 bit.

CopySign(BigInteger, BigInteger)

Copia il segno di un valore nel segno di un altro valore.

CreateChecked<TOther>(TOther)

Crea un'istanza del tipo corrente da un valore, generando un'eccezione di overflow per tutti i valori che non rientrano nell'intervallo rappresentabile del tipo corrente.

CreateSaturating<TOther>(TOther)

Crea un'istanza del tipo corrente da un valore, saturando tutti i valori che non rientrano nell'intervallo rappresentabile del tipo corrente.

CreateTruncating<TOther>(TOther)

Crea un'istanza del tipo corrente da un valore, troncando tutti i valori che non rientrano nell'intervallo rappresentabile del tipo corrente.

Divide(BigInteger, BigInteger)

Divide un BigInteger valore per un altro e restituisce il risultato.

DivRem(BigInteger, BigInteger, BigInteger)

Divide un BigInteger valore per un altro, restituisce il risultato e restituisce il resto in un parametro di output.

DivRem(BigInteger, BigInteger)

Calcola il quoziente e il resto di due valori.

Equals(BigInteger)

Restituisce un valore che indica se l'istanza corrente e un oggetto specificato BigInteger hanno lo stesso valore.

Equals(Int64)

Restituisce un valore che indica se l'istanza corrente e un intero con segno a 64 bit hanno lo stesso valore.

Equals(Object)

Restituisce un valore che indica se l'istanza corrente e un oggetto specificato hanno lo stesso valore.

Equals(UInt64)

Restituisce un valore che indica se l'istanza corrente e un intero senza segno a 64 bit hanno lo stesso valore.

GetBitLength()

Ottiene il numero di bit necessari per la rappresentazione di complemento più breve dell'istanza corrente senza il bit del segno.

GetByteCount(Boolean)

Ottiene il numero di byte che verranno restituiti da ToByteArray(Boolean, Boolean) e TryWriteBytes(Span<Byte>, Int32, Boolean, Boolean).

GetHashCode()

Restituisce il codice hash per l'oggetto corrente BigInteger .

GreatestCommonDivisor(BigInteger, BigInteger)

Trova il divisore comune più grande di due BigInteger valori.

IsEvenInteger(BigInteger)

Determina se un valore rappresenta un numero integrale pari.

IsNegative(BigInteger)

Determina se un valore è negativo.

IsOddInteger(BigInteger)

Determina se un valore rappresenta un numero integrale dispari.

IsPositive(BigInteger)

Determina se un valore è positivo.

IsPow2(BigInteger)

Determina se un valore è una potenza di due.

LeadingZeroCount(BigInteger)

Calcola il numero di zeri iniziali in un valore.

Log(BigInteger, Double)

Restituisce il logaritmo di un numero specificato in una base specificata.

Log(BigInteger)

Restituisce il logaritmo naturale (base e) di un numero specificato.

Log10(BigInteger)

Restituisce il logaritmo di base 10 di un numero specificato.

Log2(BigInteger)

Calcola il log2 di un valore.

Max(BigInteger, BigInteger)

Restituisce il valore maggiore di due BigInteger valori.

MaxMagnitude(BigInteger, BigInteger)

Confronta due valori con il calcolo maggiore.

Min(BigInteger, BigInteger)

Restituisce il più piccolo di due BigInteger valori.

MinMagnitude(BigInteger, BigInteger)

Confronta due valori con il calcolo minore.

ModPow(BigInteger, BigInteger, BigInteger)

Esegue la divisione modulo su un numero elevato alla potenza di un altro numero.

Multiply(BigInteger, BigInteger)

Restituisce il prodotto di due BigInteger valori.

Negate(BigInteger)

Nega un valore specificato BigInteger .

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Rappresenta un intero con segno di dimensioni arbitrarie.

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Rappresenta un intero con segno di dimensioni arbitrarie.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Analizza un intervallo di caratteri in un valore.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Converte la rappresentazione di un numero, contenuta nell'intervallo di caratteri di sola lettura specificato, in uno stile specificato nell'equivalente BigInteger .

Parse(String, IFormatProvider)

Converte la rappresentazione di stringa di un numero in un formato specifico delle impostazioni cultura specificato nell'equivalente BigInteger .

Parse(String, NumberStyles, IFormatProvider)

Converte la rappresentazione di stringa di un numero in uno stile e un formato specifico delle impostazioni cultura specificati nell'equivalente BigInteger .

Parse(String, NumberStyles)

Converte la rappresentazione di stringa di un numero in uno stile specificato nell'equivalente BigInteger .

Parse(String)

Converte la rappresentazione di stringa di un numero nell'equivalente BigInteger .

PopCount(BigInteger)

Calcola il numero di bit impostati in un valore.

Pow(BigInteger, Int32)

Genera un BigInteger valore alla potenza di un valore specificato.

Remainder(BigInteger, BigInteger)

Esegue la divisione integer su due BigInteger valori e restituisce il resto.

RotateLeft(BigInteger, Int32)

Ruota un valore a sinistra di una determinata quantità.

RotateRight(BigInteger, Int32)

Ruota un valore a destra di una determinata quantità.

Subtract(BigInteger, BigInteger)

Sottrae un BigInteger valore da un altro e restituisce il risultato.

ToByteArray()

Converte un BigInteger valore in una matrice di byte.

ToByteArray(Boolean, Boolean)

Restituisce il valore di questo BigInteger oggetto come matrice di byte usando il minor numero di byte possibile. Se il valore è zero, restituisce una matrice di un byte il cui elemento è 0x00.

ToString()

Converte il valore numerico dell'oggetto corrente BigInteger nella rappresentazione di stringa equivalente.

ToString(IFormatProvider)

Converte il valore numerico dell'oggetto corrente BigInteger nella rappresentazione di stringa equivalente utilizzando le informazioni di formattazione specifiche delle impostazioni cultura specificate.

ToString(String, IFormatProvider)

Converte il valore numerico dell'oggetto corrente BigInteger nella rappresentazione di stringa equivalente utilizzando il formato specificato e le informazioni sul formato specifiche delle impostazioni cultura.

ToString(String)

Converte il valore numerico dell'oggetto corrente BigInteger nella rappresentazione di stringa equivalente utilizzando il formato specificato.

TrailingZeroCount(BigInteger)

Calcola il numero di zeri finali in un valore.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Formatta questa istanza di integer grande in un intervallo di caratteri.

TryParse(ReadOnlySpan<Byte>, BigInteger)

Rappresenta un intero con segno di dimensioni arbitrarie.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, BigInteger)

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

TryParse(ReadOnlySpan<Char>, BigInteger)

Tenta di convertire la rappresentazione di un numero contenuto nell'intervallo di caratteri di sola lettura specificato, nell'equivalente BigInteger e restituisce un valore che indica se la conversione è riuscita.

TryParse(ReadOnlySpan<Char>, IFormatProvider, BigInteger)

Tenta di analizzare un intervallo di caratteri in un valore.

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

Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo.

TryParse(String, BigInteger)

Tenta di convertire la rappresentazione di stringa di un numero nell'equivalente BigInteger e restituisce un valore che indica se la conversione ha avuto esito positivo.

TryParse(String, IFormatProvider, BigInteger)

Tenta di analizzare una stringa in un valore.

TryParse(String, NumberStyles, IFormatProvider, BigInteger)

Tenta di convertire la rappresentazione di stringa di un numero in uno stile e un formato BigInteger specifico delle impostazioni cultura specificati nell'equivalente e restituisce un valore che indica se la conversione è riuscita.

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

Copia il valore di questo BigInteger valore come byte di complemento little-endian, utilizzando il minor numero di byte possibili. Se il valore è zero, restituisce un byte il cui elemento è 0x00.

Operatori

Nome Descrizione
Addition(BigInteger, BigInteger)

Aggiunge i valori di due oggetti specificati BigInteger .

BitwiseAnd(BigInteger, BigInteger)

Esegue un'operazione bit per And bit su due BigInteger valori.

BitwiseOr(BigInteger, BigInteger)

Esegue un'operazione bit per Or bit su due BigInteger valori.

Decrement(BigInteger)

Decrementa un BigInteger valore di 1.

Division(BigInteger, BigInteger)

Divide un valore specificato BigInteger in base a un altro valore specificato BigInteger utilizzando la divisione integer.

Equality(BigInteger, BigInteger)

Restituisce un valore che indica se i valori di due BigInteger oggetti sono uguali.

Equality(BigInteger, Int64)

Restituisce un valore che indica se un BigInteger valore e un valore long integer con segno sono uguali.

Equality(BigInteger, UInt64)

Restituisce un valore che indica se un BigInteger valore e un valore intero lungo senza segno sono uguali.

Equality(Int64, BigInteger)

Restituisce un valore che indica se un valore long integer con segno e un BigInteger valore sono uguali.

Equality(UInt64, BigInteger)

Restituisce un valore che indica se un valore intero long senza segno e un BigInteger valore sono uguali.

ExclusiveOr(BigInteger, BigInteger)

Esegue un'operazione esclusiva Or bit per bit (XOr) su due BigInteger valori.

Explicit(BFloat16 to BigInteger)

Rappresenta un intero con segno di dimensioni arbitrarie.

Explicit(BigInteger to BFloat16)

Rappresenta un intero con segno di dimensioni arbitrarie.

Explicit(BigInteger to Byte)

Definisce una conversione esplicita di un BigInteger oggetto in un valore di byte senza segno.

Explicit(BigInteger to Char)

Converte in modo esplicito un intero grande in un Char valore.

Explicit(BigInteger to Decimal)

Definisce una conversione esplicita di un BigInteger oggetto in un Decimal valore.

Explicit(BigInteger to Double)

Definisce una conversione esplicita di un BigInteger oggetto in un Double valore.

Explicit(BigInteger to Half)

Converte in modo esplicito un intero grande in un Half valore.

Explicit(BigInteger to Int128)

Converte in modo esplicito un intero grande in un Int128 valore.

Explicit(BigInteger to Int16)

Definisce una conversione esplicita di un BigInteger oggetto in un valore intero con segno a 16 bit.

Explicit(BigInteger to Int32)

Definisce una conversione esplicita di un BigInteger oggetto in un valore intero con segno a 32 bit.

Explicit(BigInteger to Int64)

Definisce una conversione esplicita di un BigInteger oggetto in un valore intero con segno a 64 bit.

Explicit(BigInteger to IntPtr)

Converte in modo esplicito un intero grande in un IntPtr valore.

Explicit(BigInteger to SByte)

Definisce una conversione esplicita di un BigInteger oggetto in un valore a 8 bit con segno.

Questa API non è conforme a CLS. L'alternativa conforme è Int16.

Explicit(BigInteger to Single)

Definisce una conversione esplicita di un BigInteger oggetto in un valore a virgola mobile a precisione singola.

Explicit(BigInteger to UInt128)

Converte in modo esplicito un intero grande in un UInt128 valore.

Explicit(BigInteger to UInt16)

Definisce una conversione esplicita di un BigInteger oggetto in un valore intero senza segno a 16 bit.

Questa API non è conforme a CLS. L'alternativa conforme è Int32.

Explicit(BigInteger to UInt32)

Definisce una conversione esplicita di un BigInteger oggetto in un valore intero senza segno a 32 bit.

Questa API non è conforme a CLS. L'alternativa conforme è Int64.

Explicit(BigInteger to UInt64)

Definisce una conversione esplicita di un BigInteger oggetto in un valore intero senza segno a 64 bit.

Questa API non è conforme a CLS. L'alternativa conforme è Double.

Explicit(BigInteger to UIntPtr)

Converte in modo esplicito un intero grande in un UIntPtr valore.

Explicit(Complex to BigInteger)

Converte in modo esplicito un Complex valore in un intero grande.

Explicit(Decimal to BigInteger)

Definisce una conversione esplicita di un Decimal oggetto in un BigInteger valore.

Explicit(Double to BigInteger)

Definisce una conversione esplicita di un Double valore in un BigInteger valore.

Explicit(Half to BigInteger)

Converte in modo esplicito un Half valore in un intero grande.

Explicit(Single to BigInteger)

Definisce una conversione esplicita di un Single valore in un BigInteger valore.

GreaterThan(BigInteger, BigInteger)

Restituisce un valore che indica se un BigInteger valore è maggiore di un altro BigInteger valore.

GreaterThan(BigInteger, Int64)

Restituisce un valore che indica se un oggetto BigInteger è maggiore di un valore intero con segno a 64 bit.

GreaterThan(BigInteger, UInt64)

Restituisce un valore che indica se un BigInteger valore è maggiore di un intero senza segno a 64 bit.

GreaterThan(Int64, BigInteger)

Restituisce un valore che indica se un intero con segno a 64 bit è maggiore di un BigInteger valore.

GreaterThan(UInt64, BigInteger)

Restituisce un valore che indica se un BigInteger valore è maggiore di un intero senza segno a 64 bit.

GreaterThanOrEqual(BigInteger, BigInteger)

Restituisce un valore che indica se un BigInteger valore è maggiore o uguale a un altro BigInteger valore.

GreaterThanOrEqual(BigInteger, Int64)

Restituisce un valore che indica se un BigInteger valore è maggiore o uguale a un intero con segno a 64 bit.

GreaterThanOrEqual(BigInteger, UInt64)

Restituisce un valore che indica se un BigInteger valore è maggiore o uguale a un valore intero senza segno a 64 bit.

GreaterThanOrEqual(Int64, BigInteger)

Restituisce un valore che indica se un intero con segno a 64 bit è maggiore o uguale a un BigInteger valore.

GreaterThanOrEqual(UInt64, BigInteger)

Restituisce un valore che indica se un intero senza segno a 64 bit è maggiore o uguale a un BigInteger valore.

Implicit(Byte to BigInteger)

Definisce una conversione implicita di un byte senza segno in un BigInteger valore.

Implicit(Char to BigInteger)

Converte in modo implicito un Char valore in un intero grande.

Implicit(Int128 to BigInteger)

Converte in modo implicito un Int128 valore in un intero grande.

Implicit(Int16 to BigInteger)

Definisce una conversione implicita di un intero con segno a 16 bit in un BigInteger valore.

Implicit(Int32 to BigInteger)

Definisce una conversione implicita di un intero con segno a 32 bit in un BigInteger valore.

Implicit(Int64 to BigInteger)

Definisce una conversione implicita di un intero con segno a 64 bit in un BigInteger valore .

Implicit(IntPtr to BigInteger)

Converte in modo implicito un IntPtr valore in un intero grande.

Implicit(SByte to BigInteger)

Definisce una conversione implicita di un intero con segno a 8 bit in un BigInteger valore.

Questa API non è conforme a CLS. L'alternativa conforme è BigInteger(Int32).

Implicit(UInt128 to BigInteger)

Converte in modo implicito un UInt128 valore in un intero grande.

Implicit(UInt16 to BigInteger)

Definisce una conversione implicita di un intero senza segno a 16 bit in un BigInteger valore.

Questa API non è conforme a CLS. L'alternativa conforme è Implicit(Int32 to BigInteger).

Implicit(UInt32 to BigInteger)

Definisce una conversione implicita di un intero senza segno a 32 bit in un BigInteger valore.

Questa API non è conforme a CLS. L'alternativa conforme è Implicit(Int64 to BigInteger).

Implicit(UInt64 to BigInteger)

Definisce una conversione implicita di un intero senza segno a 64 bit in un BigInteger valore.

Questa API non è conforme a CLS. L'alternativa conforme è Double.

Implicit(UIntPtr to BigInteger)

Converte in modo implicito un UIntPtr valore in un intero grande.

Increment(BigInteger)

Incrementa un BigInteger valore di 1.

Inequality(BigInteger, BigInteger)

Restituisce un valore che indica se due BigInteger oggetti hanno valori diversi.

Inequality(BigInteger, Int64)

Restituisce un valore che indica se un BigInteger valore e un intero con segno a 64 bit non sono uguali.

Inequality(BigInteger, UInt64)

Restituisce un valore che indica se un BigInteger valore e un intero senza segno a 64 bit non sono uguali.

Inequality(Int64, BigInteger)

Restituisce un valore che indica se un intero con segno a 64 bit e un BigInteger valore non sono uguali.

Inequality(UInt64, BigInteger)

Restituisce un valore che indica se un intero senza segno a 64 bit e un BigInteger valore non sono uguali.

LeftShift(BigInteger, Int32)

Sposta un valore di BigInteger un numero specificato di bit a sinistra.

LessThan(BigInteger, BigInteger)

Restituisce un valore che indica se un BigInteger valore è minore di un altro BigInteger valore.

LessThan(BigInteger, Int64)

Restituisce un valore che indica se un BigInteger valore è minore di un intero con segno a 64 bit.

LessThan(BigInteger, UInt64)

Restituisce un valore che indica se un BigInteger valore è minore di un intero senza segno a 64 bit.

LessThan(Int64, BigInteger)

Restituisce un valore che indica se un intero con segno a 64 bit è minore di un BigInteger valore.

LessThan(UInt64, BigInteger)

Restituisce un valore che indica se un intero senza segno a 64 bit è minore di un BigInteger valore.

LessThanOrEqual(BigInteger, BigInteger)

Restituisce un valore che indica se un BigInteger valore è minore o uguale a un altro BigInteger valore.

LessThanOrEqual(BigInteger, Int64)

Restituisce un valore che indica se un BigInteger valore è minore o uguale a un intero con segno a 64 bit.

LessThanOrEqual(BigInteger, UInt64)

Restituisce un valore che indica se un BigInteger valore è minore o uguale a un intero senza segno a 64 bit.

LessThanOrEqual(Int64, BigInteger)

Restituisce un valore che indica se un intero con segno a 64 bit è minore o uguale a un BigInteger valore.

LessThanOrEqual(UInt64, BigInteger)

Restituisce un valore che indica se un intero senza segno a 64 bit è minore o uguale a un BigInteger valore.

Modulus(BigInteger, BigInteger)

Restituisce il resto risultante dalla divisione con due valori specificati BigInteger .

Multiply(BigInteger, BigInteger)

Moltiplica due valori specificati BigInteger .

OnesComplement(BigInteger)

Restituisce il complemento bit per bit di un BigInteger valore.

RightShift(BigInteger, Int32)

Sposta un valore di BigInteger un numero specificato di bit a destra.

Subtraction(BigInteger, BigInteger)

Sottrae un BigInteger valore da un altro BigInteger valore.

UnaryNegation(BigInteger)

Nega un valore BigInteger specificato.

UnaryPlus(BigInteger)

Restituisce il valore dell'operando BigInteger . Il segno dell'operando è invariato.

UnsignedRightShift(BigInteger, Int32)

Sposta un valore a destra di una determinata quantità.

Implementazioni dell'interfaccia esplicita

Nome Descrizione
IAdditiveIdentity<BigInteger,BigInteger>.AdditiveIdentity

Ottiene l'identità aggiuntiva del tipo corrente.

IBinaryInteger<BigInteger>.GetByteCount()

Ottiene il numero di byte che verranno scritti come parte di TryWriteLittleEndian(Span<Byte>, Int32).

IBinaryInteger<BigInteger>.GetShortestBitLength()

Ottiene la lunghezza, espressa in bit, della rappresentazione complementare più breve del valore corrente.

IBinaryInteger<BigInteger>.Log10(BigInteger)

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Prova a scrivere il valore corrente, in formato big-endian, in un intervallo specificato.

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

Prova a scrivere il valore corrente, in formato little-endian, in un intervallo specificato.

IBinaryNumber<BigInteger>.AllBitsSet

Ottiene un'istanza del tipo binario in cui vengono impostati tutti i bit.

IComparable.CompareTo(Object)

Confronta questa istanza con un oggetto specificato e restituisce un numero intero che indica se il valore di questa istanza è minore, uguale o maggiore del valore dell'oggetto specificato.

IMultiplicativeIdentity<BigInteger,BigInteger>.MultiplicativeIdentity

Ottiene l'identità moltiplicativa del tipo corrente.

INumber<BigInteger>.MaxNumber(BigInteger, BigInteger)

Confronta due valori con il calcolo maggiore e restituisce l'altro valore se un input è NaN.

INumber<BigInteger>.MinNumber(BigInteger, BigInteger)

Confronta due valori con il calcolo minore e restituisce l'altro valore se un input è NaN.

INumber<BigInteger>.Sign(BigInteger)

Calcola il segno di un valore.

INumberBase<BigInteger>.IsCanonical(BigInteger)

Determina se un valore è nella relativa rappresentazione canonica.

INumberBase<BigInteger>.IsComplexNumber(BigInteger)

Determina se un valore rappresenta un numero complesso.

INumberBase<BigInteger>.IsFinite(BigInteger)

Determina se un valore è finito.

INumberBase<BigInteger>.IsImaginaryNumber(BigInteger)

Determina se un valore rappresenta un numero immaginario puro.

INumberBase<BigInteger>.IsInfinity(BigInteger)

Determina se un valore è infinito.

INumberBase<BigInteger>.IsInteger(BigInteger)

Determina se un valore rappresenta un numero integrale.

INumberBase<BigInteger>.IsNaN(BigInteger)

Determina se un valore è NaN.

INumberBase<BigInteger>.IsNegativeInfinity(BigInteger)

Determina se un valore è infinito negativo.

INumberBase<BigInteger>.IsNormal(BigInteger)

Determina se un valore è normale.

INumberBase<BigInteger>.IsPositiveInfinity(BigInteger)

Determina se un valore è infinito positivo.

INumberBase<BigInteger>.IsRealNumber(BigInteger)

Determina se un valore rappresenta un numero reale.

INumberBase<BigInteger>.IsSubnormal(BigInteger)

Determina se un valore è sottonormamale.

INumberBase<BigInteger>.IsZero(BigInteger)

Determina se un valore è zero.

INumberBase<BigInteger>.MaxMagnitudeNumber(BigInteger, BigInteger)

Confronta due valori con il calcolo con la grandezza maggiore e restituisce l'altro valore se un input è NaN.

INumberBase<BigInteger>.MinMagnitudeNumber(BigInteger, BigInteger)

Confronta due valori con il calcolo con la grandezza minore e restituisce l'altro valore se un input è NaN.

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

Calcola una stima di (left * right) + . addend

INumberBase<BigInteger>.Radix

Ottiene la radice o la base del tipo.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Rappresenta un intero con segno di dimensioni arbitrarie.

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

Tenta di convertire un'istanza del tipo corrente in un altro tipo, generando un'eccezione di overflow per tutti i valori che non rientrano nell'intervallo rappresentabile del tipo corrente.

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

Tenta di convertire un'istanza del tipo corrente in un altro tipo, saturando tutti i valori che non rientrano nell'intervallo rappresentabile del tipo corrente.

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

Tenta di convertire un'istanza del tipo corrente in un altro tipo, troncando tutti i valori che non rientrano nell'intervallo rappresentabile del tipo corrente.

ISignedNumber<BigInteger>.NegativeOne

Ottiene il valore -1 per il tipo.

Si applica a