Int64 Structure

Définition

Représente un entier signé 64 bits.

public value class long : IComparable, IComparable<long>, IConvertible, IEquatable<long>, IFormattable
public value class long : IComparable<long>, IConvertible, IEquatable<long>, IParsable<long>, ISpanParsable<long>, IUtf8SpanParsable<long>, System::Numerics::IAdditionOperators<long, long, long>, System::Numerics::IAdditiveIdentity<long, long>, System::Numerics::IBinaryInteger<long>, System::Numerics::IBinaryNumber<long>, System::Numerics::IBitwiseOperators<long, long, long>, System::Numerics::IComparisonOperators<long, long, bool>, System::Numerics::IDecrementOperators<long>, System::Numerics::IDivisionOperators<long, long, long>, System::Numerics::IEqualityOperators<long, long, bool>, System::Numerics::IIncrementOperators<long>, System::Numerics::IMinMaxValue<long>, System::Numerics::IModulusOperators<long, long, long>, System::Numerics::IMultiplicativeIdentity<long, long>, System::Numerics::IMultiplyOperators<long, long, long>, System::Numerics::INumber<long>, System::Numerics::INumberBase<long>, System::Numerics::IShiftOperators<long, int, long>, System::Numerics::ISignedNumber<long>, System::Numerics::ISubtractionOperators<long, long, long>, System::Numerics::IUnaryNegationOperators<long, long>, System::Numerics::IUnaryPlusOperators<long, long>
public value class long : IComparable, IComparable<long>, IConvertible, IEquatable<long>, ISpanFormattable
public value class long : IComparable<long>, IConvertible, IEquatable<long>, IParsable<long>, ISpanParsable<long>, System::Numerics::IAdditionOperators<long, long, long>, System::Numerics::IAdditiveIdentity<long, long>, System::Numerics::IBinaryInteger<long>, System::Numerics::IBinaryNumber<long>, System::Numerics::IBitwiseOperators<long, long, long>, System::Numerics::IComparisonOperators<long, long, bool>, System::Numerics::IDecrementOperators<long>, System::Numerics::IDivisionOperators<long, long, long>, System::Numerics::IEqualityOperators<long, long, bool>, System::Numerics::IIncrementOperators<long>, System::Numerics::IMinMaxValue<long>, System::Numerics::IModulusOperators<long, long, long>, System::Numerics::IMultiplicativeIdentity<long, long>, System::Numerics::IMultiplyOperators<long, long, long>, System::Numerics::INumber<long>, System::Numerics::INumberBase<long>, System::Numerics::IShiftOperators<long, int, long>, System::Numerics::ISignedNumber<long>, System::Numerics::ISubtractionOperators<long, long, long>, System::Numerics::IUnaryNegationOperators<long, long>, System::Numerics::IUnaryPlusOperators<long, long>
public value class long : IComparable, IConvertible, IFormattable
public value class long : IComparable, IComparable<long>, IEquatable<long>, IFormattable
public struct Int64 : IComparable, IComparable<long>, IConvertible, IEquatable<long>, IFormattable
public readonly struct Int64 : IComparable<long>, IConvertible, IEquatable<long>, IParsable<long>, ISpanParsable<long>, IUtf8SpanParsable<long>, System.Numerics.IAdditionOperators<long,long,long>, System.Numerics.IAdditiveIdentity<long,long>, System.Numerics.IBinaryInteger<long>, System.Numerics.IBinaryNumber<long>, System.Numerics.IBitwiseOperators<long,long,long>, System.Numerics.IComparisonOperators<long,long,bool>, System.Numerics.IDecrementOperators<long>, System.Numerics.IDivisionOperators<long,long,long>, System.Numerics.IEqualityOperators<long,long,bool>, System.Numerics.IIncrementOperators<long>, System.Numerics.IMinMaxValue<long>, System.Numerics.IModulusOperators<long,long,long>, System.Numerics.IMultiplicativeIdentity<long,long>, System.Numerics.IMultiplyOperators<long,long,long>, System.Numerics.INumber<long>, System.Numerics.INumberBase<long>, System.Numerics.IShiftOperators<long,int,long>, System.Numerics.ISignedNumber<long>, System.Numerics.ISubtractionOperators<long,long,long>, System.Numerics.IUnaryNegationOperators<long,long>, System.Numerics.IUnaryPlusOperators<long,long>
public readonly struct Int64 : IComparable, IComparable<long>, IConvertible, IEquatable<long>, IFormattable
public readonly struct Int64 : IComparable, IComparable<long>, IConvertible, IEquatable<long>, ISpanFormattable
public readonly struct Int64 : IComparable<long>, IConvertible, IEquatable<long>, IParsable<long>, ISpanParsable<long>, System.Numerics.IAdditionOperators<long,long,long>, System.Numerics.IAdditiveIdentity<long,long>, System.Numerics.IBinaryInteger<long>, System.Numerics.IBinaryNumber<long>, System.Numerics.IBitwiseOperators<long,long,long>, System.Numerics.IComparisonOperators<long,long,bool>, System.Numerics.IDecrementOperators<long>, System.Numerics.IDivisionOperators<long,long,long>, System.Numerics.IEqualityOperators<long,long,bool>, System.Numerics.IIncrementOperators<long>, System.Numerics.IMinMaxValue<long>, System.Numerics.IModulusOperators<long,long,long>, System.Numerics.IMultiplicativeIdentity<long,long>, System.Numerics.IMultiplyOperators<long,long,long>, System.Numerics.INumber<long>, System.Numerics.INumberBase<long>, System.Numerics.IShiftOperators<long,int,long>, System.Numerics.ISignedNumber<long>, System.Numerics.ISubtractionOperators<long,long,long>, System.Numerics.IUnaryNegationOperators<long,long>, System.Numerics.IUnaryPlusOperators<long,long>
[System.Serializable]
public struct Int64 : IComparable, IConvertible, IFormattable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Int64 : IComparable, IComparable<long>, IConvertible, IEquatable<long>, IFormattable
public struct Int64 : IComparable, IComparable<long>, IEquatable<long>, IFormattable
type int64 = struct
    interface IConvertible
    interface IFormattable
type int64 = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<int64>
    interface ISpanFormattable
    interface ISpanParsable<int64>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<int64>
    interface IAdditionOperators<int64, int64, int64>
    interface IAdditiveIdentity<int64, int64>
    interface IBinaryInteger<int64>
    interface IBinaryNumber<int64>
    interface IBitwiseOperators<int64, int64, int64>
    interface IComparisonOperators<int64, int64, bool>
    interface IEqualityOperators<int64, int64, bool>
    interface IDecrementOperators<int64>
    interface IDivisionOperators<int64, int64, int64>
    interface IIncrementOperators<int64>
    interface IModulusOperators<int64, int64, int64>
    interface IMultiplicativeIdentity<int64, int64>
    interface IMultiplyOperators<int64, int64, int64>
    interface INumber<int64>
    interface INumberBase<int64>
    interface ISubtractionOperators<int64, int64, int64>
    interface IUnaryNegationOperators<int64, int64>
    interface IUnaryPlusOperators<int64, int64>
    interface IShiftOperators<int64, int, int64>
    interface IMinMaxValue<int64>
    interface ISignedNumber<int64>
type int64 = struct
    interface IConvertible
    interface ISpanFormattable
    interface IFormattable
type int64 = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<int64>
    interface ISpanFormattable
    interface ISpanParsable<int64>
    interface IAdditionOperators<int64, int64, int64>
    interface IAdditiveIdentity<int64, int64>
    interface IBinaryInteger<int64>
    interface IBinaryNumber<int64>
    interface IBitwiseOperators<int64, int64, int64>
    interface IComparisonOperators<int64, int64, bool>
    interface IEqualityOperators<int64, int64, bool>
    interface IDecrementOperators<int64>
    interface IDivisionOperators<int64, int64, int64>
    interface IIncrementOperators<int64>
    interface IModulusOperators<int64, int64, int64>
    interface IMultiplicativeIdentity<int64, int64>
    interface IMultiplyOperators<int64, int64, int64>
    interface INumber<int64>
    interface INumberBase<int64>
    interface ISubtractionOperators<int64, int64, int64>
    interface IUnaryNegationOperators<int64, int64>
    interface IUnaryPlusOperators<int64, int64>
    interface IShiftOperators<int64, int, int64>
    interface IMinMaxValue<int64>
    interface ISignedNumber<int64>
type int64 = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<int64>
    interface ISpanFormattable
    interface ISpanParsable<int64>
    interface IAdditionOperators<int64, int64, int64>
    interface IAdditiveIdentity<int64, int64>
    interface IBinaryInteger<int64>
    interface IBinaryNumber<int64>
    interface IBitwiseOperators<int64, int64, int64>
    interface IComparisonOperators<int64, int64, bool>
    interface IEqualityOperators<int64, int64, bool>
    interface IDecrementOperators<int64>
    interface IDivisionOperators<int64, int64, int64>
    interface IIncrementOperators<int64>
    interface IModulusOperators<int64, int64, int64>
    interface IMultiplicativeIdentity<int64, int64>
    interface IMultiplyOperators<int64, int64, int64>
    interface INumber<int64>
    interface INumberBase<int64>
    interface ISubtractionOperators<int64, int64, int64>
    interface IUnaryNegationOperators<int64, int64>
    interface IUnaryPlusOperators<int64, int64>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<int64>
    interface IShiftOperators<int64, int, int64>
    interface IMinMaxValue<int64>
    interface ISignedNumber<int64>
[<System.Serializable>]
type int64 = struct
    interface IFormattable
    interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type int64 = struct
    interface IFormattable
    interface IConvertible
type int64 = struct
    interface IFormattable
Public Structure Int64
Implements IComparable, IComparable(Of Long), IConvertible, IEquatable(Of Long), IFormattable
Public Structure Int64
Implements IAdditionOperators(Of Long, Long, Long), IAdditiveIdentity(Of Long, Long), IBinaryInteger(Of Long), IBinaryNumber(Of Long), IBitwiseOperators(Of Long, Long, Long), IComparable(Of Long), IComparisonOperators(Of Long, Long, Boolean), IConvertible, IDecrementOperators(Of Long), IDivisionOperators(Of Long, Long, Long), IEqualityOperators(Of Long, Long, Boolean), IEquatable(Of Long), IIncrementOperators(Of Long), IMinMaxValue(Of Long), IModulusOperators(Of Long, Long, Long), IMultiplicativeIdentity(Of Long, Long), IMultiplyOperators(Of Long, Long, Long), INumber(Of Long), INumberBase(Of Long), IParsable(Of Long), IShiftOperators(Of Long, Integer, Long), ISignedNumber(Of Long), ISpanParsable(Of Long), ISubtractionOperators(Of Long, Long, Long), IUnaryNegationOperators(Of Long, Long), IUnaryPlusOperators(Of Long, Long), IUtf8SpanParsable(Of Long)
Public Structure Int64
Implements IComparable, IComparable(Of Long), IConvertible, IEquatable(Of Long), ISpanFormattable
Public Structure Int64
Implements IAdditionOperators(Of Long, Long, Long), IAdditiveIdentity(Of Long, Long), IBinaryInteger(Of Long), IBinaryNumber(Of Long), IBitwiseOperators(Of Long, Long, Long), IComparable(Of Long), IComparisonOperators(Of Long, Long, Boolean), IConvertible, IDecrementOperators(Of Long), IDivisionOperators(Of Long, Long, Long), IEqualityOperators(Of Long, Long, Boolean), IEquatable(Of Long), IIncrementOperators(Of Long), IMinMaxValue(Of Long), IModulusOperators(Of Long, Long, Long), IMultiplicativeIdentity(Of Long, Long), IMultiplyOperators(Of Long, Long, Long), INumber(Of Long), INumberBase(Of Long), IParsable(Of Long), IShiftOperators(Of Long, Integer, Long), ISignedNumber(Of Long), ISpanParsable(Of Long), ISubtractionOperators(Of Long, Long, Long), IUnaryNegationOperators(Of Long, Long), IUnaryPlusOperators(Of Long, Long)
Public Structure Int64
Implements IComparable, IConvertible, IFormattable
Public Structure Int64
Implements IComparable, IComparable(Of Long), IEquatable(Of Long), IFormattable
Héritage
Attributs
Implémente
IComparable IComparable<Int64> IConvertible IEquatable<Int64> IFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<Int64> IParsable<TSelf> ISpanFormattable ISpanParsable<Int64> ISpanParsable<TSelf> IUtf8SpanFormattable IUtf8SpanParsable<Int64> IUtf8SpanParsable<TSelf> IAdditionOperators<Int64,Int64,Int64> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<Int64,Int64> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<Int64> IBinaryNumber<Int64> IBinaryNumber<TSelf> IBitwiseOperators<Int64,Int64,Int64> IBitwiseOperators<TSelf,TSelf,TSelf> IComparisonOperators<Int64,Int64,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<Int64> IDecrementOperators<TSelf> IDivisionOperators<Int64,Int64,Int64> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<Int64,Int64,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<Int64> IIncrementOperators<TSelf> IMinMaxValue<Int64> IModulusOperators<Int64,Int64,Int64> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<Int64,Int64> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<Int64,Int64,Int64> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<Int64> INumber<TSelf> INumberBase<Int64> INumberBase<TSelf> IShiftOperators<Int64,Int32,Int64> IShiftOperators<TSelf,Int32,TSelf> ISignedNumber<Int64> ISubtractionOperators<Int64,Int64,Int64> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<Int64,Int64> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<Int64,Int64> IUnaryPlusOperators<TSelf,TSelf>

Remarques

Int64 est un type valeur immuable qui représente des entiers signés avec des valeurs comprises entre 9 223 372 036 854 775 808 (qui est représenté par la Int64.MinValue constante) à 9 223 372 036 854 775 807 (qui est représenté par la Int64.MaxValue constante). .NET inclut également un type entier 64 bits non signé, UInt64qui représente des valeurs comprises entre 0 et 18 446 744 073 709 551 615.

Instancier une valeur Int64

Vous pouvez instancier une Int64 valeur de plusieurs façons :

  • Vous pouvez déclarer une Int64 variable et l’affecter à une valeur entière littérale qui se trouve dans la plage du Int64 type de données. L’exemple suivant déclare deux Int64 variables et leur attribue des valeurs de cette façon.

    long number1 = -64301728;
    long number2 = 255486129307;
    
    let number1 = -64301728L
    let number2 = 255486129307L
    
    Dim number1 As Long = -64301728
    Dim number2 As Long = 255486129307
    
  • Vous pouvez affecter la valeur d’un type intégral dont la plage est un sous-ensemble du Int64 type. Il s’agit d’une conversion étendue qui ne nécessite pas d’opérateur de cast en C# ou d’une méthode de conversion en Visual Basic. En F#, seul le Int32 type peut être étendu automatiquement.

    sbyte value1 = 124;
    short value2 = 1618;
    int value3 = Int32.MaxValue;
    
    long number1 = value1;
    long number2 = value2;
    long number3 = value3;
    
    let value1 = 124y
    let value2 = 1618s
    let value3 = Int32.MaxValue
    
    let number1 = int64 value1
    let number2 = int64 value2
    let number3: int64 = value3
    
    Dim value1 As SByte = 124
    Dim value2 As Int16 = 1618
    Dim value3 As Int32 = Int32.MaxValue
    
    Dim number1 As Long = value1
    Dim number2 As Long = value2
    Dim number3 As Long = value3
    
  • Vous pouvez affecter la valeur d’un type numérique dont la plage dépasse celle du Int64 type. Il s'agit d'une conversion étroite, donc elle nécessite un opérateur de cast en C# ou F#, et une méthode de conversion en Visual Basic si Option Strict est activé. Si la valeur numérique est un Single, Doubleou Decimal une valeur qui inclut un composant fractionnaire, la gestion de sa partie fractionnaire dépend du compilateur effectuant la conversion. L’exemple suivant effectue des conversions restrictives pour affecter plusieurs valeurs numériques à des Int64 variables.

    ulong ulNumber = 163245617943825;
    try {
       long number1 = (long) ulNumber;
       Console.WriteLine(number1);
    }
    catch (OverflowException) {
       Console.WriteLine($"{ulNumber} is out of range of an Int64.");
    }
    
    double dbl2 = 35901.997;
    try {
       long number2 = (long) dbl2;
       Console.WriteLine(number2);
    }
    catch (OverflowException) {
       Console.WriteLine($"{dbl2} is out of range of an Int64.");
    }
    
    BigInteger bigNumber = (BigInteger) 1.63201978555e30;
    try {
       long number3 = (long) bigNumber;
       Console.WriteLine(number3);
    }
    catch (OverflowException) {
       Console.WriteLine($"{bigNumber} is out of range of an Int64.");
    }
    // The example displays the following output:
    //    163245617943825
    //    35902
    //    1,632,019,785,549,999,969,612,091,883,520 is out of range of an Int64.
    
    let ulNumber = 163245617943825uL
    try
        let number1 = int64 ulNumber
        printfn $"{number1}"
    with :? OverflowException ->
        printfn $"{ulNumber} is out of range of an Int64."
    
    let dbl2 = 35901.997
    try
        let number2 = int64 dbl2
        printfn $"{number2}"
    with :? OverflowException ->
        printfn $"{dbl2} is out of range of an Int64."
    
    let bigNumber = BigInteger 1.63201978555e30
    try
        let number3 = int64 bigNumber
        printfn $"{number3}"
    with :? OverflowException ->
        printfn $"{bigNumber} is out of range of an Int64."
    
    // The example displays the following output:
    //    163245617943825
    //    35902
    //    1,632,019,785,549,999,969,612,091,883,520 is out of range of an Int64.
    
    Dim ulNumber As ULong = 163245617943825
    Try
       Dim number1 As Long = CLng(ulNumber)
       Console.WriteLine(number1)
    Catch e As OverflowException
       Console.WriteLine("{0} is out of range of an Int64.", ulNumber)
    End Try
    
    Dim dbl2 As Double = 35901.997
    Try
       Dim number2 As Long = CLng(dbl2)
       Console.WriteLine(number2)
    Catch e As OverflowException
       Console.WriteLine("{0} is out of range of an Int64.", dbl2)
    End Try
       
    Dim bigNumber As BigInteger = 1.63201978555e30
    Try
       Dim number3 As Long = CLng(bigNumber)
       Console.WriteLine(number3)
    Catch e As OverflowException
       Console.WriteLine("{0:N0} is out of range of an Int64.", bigNumber)
    End Try    
    ' The example displays the following output:
    '    163245617943825
    '    35902
    '    1,632,019,785,549,999,969,612,091,883,520 is out of range of an Int64.
    
  • Vous pouvez appeler une méthode de la Convert classe pour convertir n’importe quel type pris en charge en Int64 valeur. Cela est possible, car Int64 prend en charge l’interface IConvertible . L’exemple suivant illustre la conversion d’un tableau de valeurs Decimal vers des valeurs Int64.

    decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
                        199.55m, 9214.16m, Decimal.MaxValue };
    long result;
    
    foreach (decimal value in values)
    {
       try {
          result = Convert.ToInt64(value);
          Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
                            value.GetType().Name, value,
                            result.GetType().Name, result);
       }
       catch (OverflowException) {
          Console.WriteLine("{0} is outside the range of the Int64 type.",
                            value);
       }
    }
    // The example displays the following output:
    //    -79228162514264337593543950335 is outside the range of the Int64 type.
    //    Converted the Decimal value '-1034.23' to the Int64 value -1034.
    //    Converted the Decimal value '-12' to the Int64 value -12.
    //    Converted the Decimal value '0' to the Int64 value 0.
    //    Converted the Decimal value '147' to the Int64 value 147.
    //    Converted the Decimal value '199.55' to the Int64 value 200.
    //    Converted the Decimal value '9214.16' to the Int64 value 9214.
    //    79228162514264337593543950335 is outside the range of the Int64 type.
    
    let values = 
        [| Decimal.MinValue; -1034.23m; -12m; 0m; 147m
           199.55m; 9214.16m; Decimal.MaxValue |]
    
    for value in values do
        try
            let result = Convert.ToInt64 value
            printfn $"Converted the {value.GetType().Name} value '{value}' to the {result.GetType().Name} value {result}."
        with :? OverflowException ->
            printfn $"{value} is outside the range of the Int64 type."
    // The example displays the following output:
    //    -79228162514264337593543950335 is outside the range of the Int64 type.
    //    Converted the Decimal value '-1034.23' to the Int64 value -1034.
    //    Converted the Decimal value '-12' to the Int64 value -12.
    //    Converted the Decimal value '0' to the Int64 value 0.
    //    Converted the Decimal value '147' to the Int64 value 147.
    //    Converted the Decimal value '199.55' to the Int64 value 200.
    //    Converted the Decimal value '9214.16' to the Int64 value 9214.
    //    79228162514264337593543950335 is outside the range of the Int64 type.
    
    Dim values() As Decimal = { Decimal.MinValue, -1034.23d, -12d, 0d, 147d, _
                                199.55d, 9214.16d, Decimal.MaxValue }
    Dim result As Long
    
    For Each value As Decimal In values
       Try
          result = Convert.ToInt64(value)
          Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", _
                            value.GetType().Name, value, _
                            result.GetType().Name, result)
       Catch e As OverflowException
          Console.WriteLine("{0} is outside the range of the Int64 type.", _
                            value)
       End Try
    Next
    ' The example displays the following output:
    '    -79228162514264337593543950335 is outside the range of the Int64 type.
    '    Converted the Decimal value '-1034.23' to the Int64 value -1034.
    '    Converted the Decimal value '-12' to the Int64 value -12.
    '    Converted the Decimal value '0' to the Int64 value 0.
    '    Converted the Decimal value '147' to the Int64 value 147.
    '    Converted the Decimal value '199.55' to the Int64 value 200.
    '    Converted the Decimal value '9214.16' to the Int64 value 9214.
    '    79228162514264337593543950335 is outside the range of the Int64 type.
    
  • Vous pouvez appeler la méthode Parse ou TryParse pour convertir la représentation en chaîne d’une valeur Int64 en Int64. La chaîne peut contenir des chiffres décimaux ou hexadécimaux. L’exemple suivant illustre l’opération d’analyse à l’aide d’une chaîne décimale et hexadécimale.

    string string1 = "244681903147";
    try {
       long number1 = Int64.Parse(string1);
       Console.WriteLine(number1);
    }
    catch (OverflowException) {
       Console.WriteLine($"'{string1}' is out of range of a 64-bit integer.");
    }
    catch (FormatException) {
       Console.WriteLine($"The format of '{string1}' is invalid.");
    }
    
    string string2 = "F9A3CFF0A";
    try {
       long number2 = Int64.Parse(string2,
                                  System.Globalization.NumberStyles.HexNumber);
       Console.WriteLine(number2);
    }
    catch (OverflowException) {
       Console.WriteLine($"'{string2}' is out of range of a 64-bit integer.");
    }
    catch (FormatException) {
       Console.WriteLine($"The format of '{string2}' is invalid.");
    }
    // The example displays the following output:
    //    244681903147
    //    67012198154
    
    let string1 = "244681903147"
    try
        let number1 = Int64.Parse string1
        printfn $"{number1}"
    with
    | :? OverflowException ->
        printfn $"'{string1}' is out of range of a 64-bit integer."
    | :? FormatException ->
        printfn $"The format of '{string1}' is invalid."
    
    let string2 = "F9A3CFF0A"
    try
        let number2 = Int64.Parse(string2, NumberStyles.HexNumber)
        printfn $"{number2}"
    
    with
    | :? OverflowException ->
        printfn $"'{string2}' is out of range of a 64-bit integer."
    | :? FormatException ->
        printfn $"The format of '{string2}' is invalid."
    
    // The example displays the following output:
    //    244681903147
    //    67012198154
    
    Dim string1 As String = "244681903147"
    Try
       Dim number1 As Long = Int64.Parse(string1)
       Console.WriteLine(number1)
    Catch e As OverflowException
       Console.WriteLine("'{0}' is out of range of a 64-bit integer.", string1)
    Catch e As FormatException
       Console.WriteLine("The format of '{0}' is invalid.", string1)
    End Try
    
    Dim string2 As String = "F9A3CFF0A"
    Try
       Dim number2 As Long = Int64.Parse(string2,
                                System.Globalization.NumberStyles.HexNumber)
       Console.WriteLine(number2)
    Catch e As OverflowException
       Console.WriteLine("'{0}' is out of range of a 64-bit integer.", string2)
    Catch e As FormatException
       Console.WriteLine("The format of '{0}' is invalid.", string2)
    End Try
    ' The example displays the following output:
    '    244681903147
    '    67012198154
    

Effectuer des opérations sur les valeurs Int64

Le Int64 type prend en charge les opérations mathématiques standard telles que l’addition, la soustraction, la division, la multiplication, la négation et la négation unaire. Comme les autres types intégraux, le Int64 type prend également en charge les opérateurs bit à bit : AND, OR, XOR, décalage à gauche et décalage à droite.

Vous pouvez utiliser les opérateurs numériques standard pour comparer deux valeurs Int64, ou vous pouvez appeler la méthode CompareTo ou Equals.

Vous pouvez également appeler les membres de la classe pour effectuer un large éventail d’opérations numériques, notamment obtenir la valeur absolue d’un nombre, calculer le quotient et le reste à partir de la Math division intégrale, déterminer la valeur maximale ou minimale de deux entiers longs, obtenir le signe d’un nombre et arrondir un nombre.

Représenter un Int64 en tant que chaîne

Le Int64 type fournit une prise en charge complète des chaînes de format numérique standard et personnalisées. (Pour plus d’informations, consultez Types de mise en forme, chaînes de format numérique standard et chaînes de format numérique personnalisées.)

Pour mettre en forme une Int64 valeur en tant que chaîne intégrale sans zéros non significatifs, vous pouvez appeler la méthode sans ToString() paramètre. En utilisant le spécificateur de format « D », vous pouvez également inclure un nombre spécifié de zéros non significatifs dans la représentation sous forme de chaîne. En utilisant le spécificateur de format « N », vous pouvez inclure des séparateurs de groupe et spécifier le nombre de chiffres décimaux à afficher dans la représentation sous forme de chaîne du nombre. En utilisant le spécificateur de format « X », vous pouvez représenter une Int64 valeur sous forme de chaîne hexadécimale. L’exemple suivant met en forme les éléments d’un tableau de Int64 valeurs de ces quatre façons.

long[] numbers = { -1403, 0, 169, 1483104 };
foreach (var number in numbers)
{
    // Display value using default formatting.
    Console.Write("{0,-8}  -->   ", number.ToString());
    // Display value with 3 digits and leading zeros.
    Console.Write("{0,8:D3}", number);
    // Display value with 1 decimal digit.
    Console.Write("{0,13:N1}", number);
    // Display value as hexadecimal.
    Console.Write("{0,18:X2}", number);
    // Display value with eight hexadecimal digits.
    Console.WriteLine("{0,18:X8}", number);
}
// The example displays the following output:
//    -1403     -->      -1403     -1,403.0  FFFFFFFFFFFFFA85  FFFFFFFFFFFFFA85
//    0         -->        000          0.0                00          00000000
//    169       -->        169        169.0                A9          000000A9
//    1483104   -->    1483104  1,483,104.0            16A160          0016A160
let numbers = [| -1403L; 0L; 169L; 1483104L |]
for number in numbers do
    // Display value using default formatting.
    printf $"{number.ToString(),-8}  -->   "
    // Display value with 3 digits and leading zeros.
    printf $"{number,8:D3}"
    // Display value with 1 decimal digit.
    printf $"{number,13:N1}"
    // Display value as hexadecimal.
    printf $"{number,18:X2}"
    // Display value with eight hexadecimal digits.
    printfn $"{number,18:X8}"

// The example displays the following output:
//    -1403     -->      -1403     -1,403.0  FFFFFFFFFFFFFA85  FFFFFFFFFFFFFA85
//    0         -->        000          0.0                00          00000000
//    169       -->        169        169.0                A9          000000A9
//    1483104   -->    1483104  1,483,104.0            16A160          0016A160
Dim numbers() As Long = { -1403, 0, 169, 1483104 }
For Each number In numbers
   ' Display value using default formatting.
   Console.Write("{0,-8}  -->   ", number.ToString())
   ' Display value with 3 digits and leading zeros.
   Console.Write("{0,8:D3}", number)
   ' Display value with 1 decimal digit.
   Console.Write("{0,13:N1}", number) 
   ' Display value as hexadecimal.
   Console.Write("{0,18:X2}", number)
   ' Display value with eight hexadecimal digits.
   Console.WriteLine("{0,18:X8}", number)
Next   
' The example displays the following output:
'    -1403     -->      -1403     -1,403.0  FFFFFFFFFFFFFA85  FFFFFFFFFFFFFA85
'    0         -->        000          0.0                00          00000000
'    169       -->        169        169.0                A9          000000A9
'    1483104   -->    1483104  1,483,104.0            16A160          0016A160

Vous pouvez également mettre en forme une Int64 valeur en tant que chaîne binaire, octal, décimale ou hexadécimale en appelant la ToString(Int64, Int32) méthode et en fournissant la base comme deuxième paramètre de la méthode. L’exemple suivant appelle cette méthode pour afficher les représentations binaires, octales et hexadécimales d’un tableau de valeurs entières.

long[] numbers = { -146, 11043, 2781913 };
foreach (var number in numbers)
{
    Console.WriteLine($"{number} (Base 10):");
    Console.WriteLine($"   Binary:  {Convert.ToString(number, 2)}");
    Console.WriteLine($"   Octal:   {Convert.ToString(number, 8)}");
    Console.WriteLine($"   Hex:     {Convert.ToString(number, 16)}{Environment.NewLine}");
}
// The example displays the following output:
//    -146 (Base 10):
//       Binary:  1111111111111111111111111111111111111111111111111111111101101110
//       Octal:   1777777777777777777556
//       Hex:     ffffffffffffff6e
//
//    11043 (Base 10):
//       Binary:  10101100100011
//       Octal:   25443
//       Hex:     2b23
//
//    2781913 (Base 10):
//       Binary:  1010100111001011011001
//       Octal:   12471331
//       Hex:     2a72d9
let numbers = [| -146L; 11043L; 2781913L |]
for number in numbers do
    printfn $"{number} (Base 10):"
    printfn $"   Binary:  {Convert.ToString(number, 2)}"
    printfn $"   Octal:   {Convert.ToString(number, 8)}"
    printfn $"   Hex:     {Convert.ToString(number, 16)}\n"

// The example displays the following output:
//    -146 (Base 10):
//       Binary:  1111111111111111111111111111111111111111111111111111111101101110
//       Octal:   1777777777777777777556
//       Hex:     ffffffffffffff6e
//
//    11043 (Base 10):
//       Binary:  10101100100011
//       Octal:   25443
//       Hex:     2b23
//
//    2781913 (Base 10):
//       Binary:  1010100111001011011001
//       Octal:   12471331
//       Hex:     2a72d9
Dim numbers() As Long = { -146, 11043, 2781913 }
For Each number In numbers
   Console.WriteLine("{0} (Base 10):", number)
   Console.WriteLine("   Binary:  {0}", Convert.ToString(number, 2))
   Console.WriteLine("   Octal:   {0}", Convert.ToString(number, 8))
   Console.WriteLine("   Hex:     {0}", Convert.ToString(number, 16))
   Console.WriteLine()
Next      
' The example displays the following output:
'    -146 (Base 10):
'       Binary:  1111111111111111111111111111111111111111111111111111111101101110
'       Octal:   1777777777777777777556
'       Hex:     ffffffffffffff6e
'
'    11043 (Base 10):
'       Binary:  10101100100011
'       Octal:   25443
'       Hex:     2b23
'
'    2781913 (Base 10):
'       Binary:  1010100111001011011001
'       Octal:   12471331
'       Hex:     2a72d9

Utiliser des valeurs entières non décimales sur 64 bits

Outre l’utilisation d’entiers longs individuels sous forme de valeurs décimales, vous pouvez effectuer des opérations au niveau du bit ou utiliser les représentations binaires ou hexadécimales des valeurs entières longues. Int64 les valeurs sont représentées en 63 bits, avec le soixante-quatrième bit utilisé comme bit de signe. Les valeurs positives sont représentées à l'aide de la représentation signe et valeur absolue. Les valeurs négatives sont dans la représentation complémentaire de deux. Il est important de garder à l’esprit lorsque vous effectuez des opérations au niveau binaire sur les valeurs Int64 ou lorsque vous travaillez avec des bits individuels. Pour effectuer une opération numérique, booléenne ou de comparaison sur deux valeurs non décimales, les deux valeurs doivent utiliser la même représentation.

Champs

Nom Description
MaxValue

Représente la plus grande valeur possible d’un Int64. Ce champ est constant.

MinValue

Représente la plus petite valeur possible d’un Int64. Ce champ est constant.

Méthodes

Nom Description
Abs(Int64)

Calcule l’absolu d’une valeur.

BigMul(Int64, Int64)

Produit le produit complet de deux nombres 64 bits.

Clamp(Int64, Int64, Int64)

Limite une valeur à une valeur minimale et maximale inclusive.

CompareTo(Int64)

Compare cette instance à un entier signé 64 bits spécifié et retourne une indication de leurs valeurs relatives.

CompareTo(Object)

Compare cette instance à un objet spécifié et retourne une indication de leurs valeurs relatives.

CopySign(Int64, Int64)

Copie le signe d’une valeur au signe d’une autre valeur.

CreateChecked<TOther>(TOther)

Crée une instance du type actuel à partir d’une valeur, lève une exception de dépassement de capacité pour toutes les valeurs qui se trouvent en dehors de la plage représentée du type actuel.

CreateSaturating<TOther>(TOther)

Crée une instance du type actuel à partir d’une valeur, en saturant toutes les valeurs qui se trouvent en dehors de la plage représentée du type actuel.

CreateTruncating<TOther>(TOther)

Crée une instance du type actuel à partir d’une valeur, tronqué toutes les valeurs qui se trouvent en dehors de la plage représentée du type actuel.

DivRem(Int64, Int64)

Calcule le quotient et le reste de deux valeurs.

Equals(Int64)

Retourne une valeur indiquant si cette instance est égale à une valeur spécifiée Int64 .

Equals(Object)

Retourne une valeur indiquant si cette instance est égale à un objet spécifié.

GetHashCode()

Retourne le code de hachage pour cette instance.

GetTypeCode()

Retourne le TypeCode type Int64valeur .

IsEvenInteger(Int64)

Détermine si une valeur représente un nombre intégral pair.

IsNegative(Int64)

Détermine si une valeur est négative.

IsOddInteger(Int64)

Détermine si une valeur représente un nombre intégral impair.

IsPositive(Int64)

Détermine si une valeur est positive.

IsPow2(Int64)

Détermine si une valeur est une puissance de deux.

LeadingZeroCount(Int64)

Calcule le nombre de zéros non significatifs dans une valeur.

Log10(Int64)

Représente un entier signé 64 bits.

Log2(Int64)

Calcule le journal2 d’une valeur.

Max(Int64, Int64)

Compare deux valeurs au calcul, ce qui est supérieur.

MaxMagnitude(Int64, Int64)

Compare deux valeurs au calcul, ce qui est supérieur.

Min(Int64, Int64)

Compare deux valeurs au calcul, ce qui est inférieur.

MinMagnitude(Int64, Int64)

Compare deux valeurs au calcul, ce qui est inférieur.

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Analyse une étendue de caractères UTF-8 en une valeur.

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Analyse une étendue de caractères UTF-8 en une valeur.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Analyse une étendue de caractères en une valeur.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Convertit la représentation d’étendue d’un nombre dans un style et un format spécifique à la culture spécifiés en son entier signé 64 bits équivalent.

Parse(String, IFormatProvider)

Convertit la représentation sous forme de chaîne d’un nombre dans un format spécifique à la culture spécifié en son équivalent entier signé 64 bits.

Parse(String, NumberStyles, IFormatProvider)

Convertit la représentation sous forme de chaîne d’un nombre dans un style et un format spécifique à la culture spécifiés en entier signé 64 bits équivalent.

Parse(String, NumberStyles)

Convertit la représentation sous forme de chaîne d’un nombre dans un style spécifié en son entier signé 64 bits équivalent.

Parse(String)

Convertit la représentation sous forme de chaîne d’un nombre en son entier signé 64 bits équivalent.

PopCount(Int64)

Calcule le nombre de bits définis dans une valeur.

RotateLeft(Int64, Int32)

Fait pivoter une valeur à gauche d’une quantité donnée.

RotateRight(Int64, Int32)

Fait pivoter une valeur à droite d’un montant donné.

Sign(Int64)

Calcule le signe d’une valeur.

ToString()

Convertit la valeur numérique de cette instance en sa représentation sous forme de chaîne équivalente.

ToString(IFormatProvider)

Convertit la valeur numérique de cette instance en sa représentation sous forme de chaîne équivalente à l’aide des informations de format spécifiques à la culture spécifiées.

ToString(String, IFormatProvider)

Convertit la valeur numérique de cette instance en sa représentation sous forme de chaîne équivalente à l’aide des informations de format spécifiques à la culture et au format spécifiés.

ToString(String)

Convertit la valeur numérique de cette instance en sa représentation sous forme de chaîne équivalente, à l’aide du format spécifié.

TrailingZeroCount(Int64)

Calcule le nombre de zéros de fin dans une valeur.

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

Tente de mettre en forme la valeur de l’instance actuelle en UTF-8 dans l’étendue fournie d’octets.

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

Tente de mettre en forme la valeur de l’instance de nombre long actuel dans l’étendue fournie de caractères.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, Int64)

Tente d’analyser une étendue de caractères UTF-8 en une valeur.

TryParse(ReadOnlySpan<Byte>, Int64)

Tente de convertir une étendue de caractères UTF-8 contenant la représentation sous forme de chaîne d’un nombre en son entier signé 64 bits équivalent.

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

Tente d’analyser une étendue de caractères UTF-8 en une valeur.

TryParse(ReadOnlySpan<Char>, IFormatProvider, Int64)

Tente d’analyser une étendue de caractères en une valeur.

TryParse(ReadOnlySpan<Char>, Int64)

Convertit la représentation d’étendue d’un nombre en son équivalent entier signé 64 bits. Une valeur de retour indique si la conversion a réussi ou échoué.

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

Convertit la représentation d’étendue d’un nombre dans un style et un format spécifique à la culture spécifiés en son entier signé 64 bits équivalent. Une valeur de retour indique si la conversion a réussi ou échoué.

TryParse(String, IFormatProvider, Int64)

Tente d’analyser une chaîne en une valeur.

TryParse(String, Int64)

Convertit la représentation sous forme de chaîne d’un nombre en son entier signé 64 bits équivalent. Une valeur de retour indique si la conversion a réussi ou échoué.

TryParse(String, NumberStyles, IFormatProvider, Int64)

Convertit la représentation sous forme de chaîne d’un nombre dans un style et un format spécifique à la culture spécifiés en entier signé 64 bits équivalent. Une valeur de retour indique si la conversion a réussi ou échoué.

Implémentations d’interfaces explicites

Nom Description
IAdditionOperators<Int64,Int64,Int64>.Addition(Int64, Int64)

Ajoute deux valeurs ensemble pour calculer leur somme.

IAdditionOperators<Int64,Int64,Int64>.CheckedAddition(Int64, Int64)

Ajoute deux valeurs ensemble pour calculer leur somme.

IAdditiveIdentity<Int64,Int64>.AdditiveIdentity

Obtient l’identité additive du type actuel.

IBinaryInteger<Int64>.GetByteCount()

Obtient le nombre d’octets qui seront écrits dans le cadre de TryWriteLittleEndian(Span<Byte>, Int32).

IBinaryInteger<Int64>.GetShortestBitLength()

Obtient la longueur, en bits, de la représentation complète des deux plus courtes de la valeur actuelle.

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

Représente un entier signé 64 bits.

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

Représente un entier signé 64 bits.

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

Tente d’écrire la valeur actuelle, au format big-endian, dans une étendue donnée.

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

Tente d’écrire la valeur actuelle, au format little-endian, dans une étendue donnée.

IBinaryNumber<Int64>.AllBitsSet

Obtient une instance du type binaire dans laquelle tous les bits sont définis.

IBitwiseOperators<Int64,Int64,Int64>.BitwiseAnd(Int64, Int64)

Calcule les valeurs au niveau du bit et de deux valeurs.

IBitwiseOperators<Int64,Int64,Int64>.BitwiseOr(Int64, Int64)

Calcule les valeurs au niveau du bit ou de deux valeurs.

IBitwiseOperators<Int64,Int64,Int64>.ExclusiveOr(Int64, Int64)

Calcule les valeurs exclusives ou de deux valeurs.

IBitwiseOperators<Int64,Int64,Int64>.OnesComplement(Int64)

Calcule la représentation complète d’une valeur donnée.

IComparable.CompareTo(Object)

Compare cette instance à un objet spécifié et retourne une indication de leurs valeurs relatives.

IComparisonOperators<Int64,Int64,Boolean>.GreaterThan(Int64, Int64)

Compare deux valeurs pour déterminer ce qui est supérieur.

IComparisonOperators<Int64,Int64,Boolean>.GreaterThanOrEqual(Int64, Int64)

Compare deux valeurs pour déterminer qui est supérieur ou égal.

IComparisonOperators<Int64,Int64,Boolean>.LessThan(Int64, Int64)

Compare deux valeurs pour déterminer ce qui est inférieur.

IComparisonOperators<Int64,Int64,Boolean>.LessThanOrEqual(Int64, Int64)

Compare deux valeurs pour déterminer qui est inférieure ou égale.

IConvertible.GetTypeCode()

Retourne le TypeCode type Int64valeur .

IConvertible.ToBoolean(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToBoolean(IFormatProvider).

IConvertible.ToByte(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToByte(IFormatProvider).

IConvertible.ToChar(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToChar(IFormatProvider).

IConvertible.ToDateTime(IFormatProvider)

Cette conversion n’est pas prise en charge. La tentative d’utilisation de cette méthode lève un InvalidCastException.

IConvertible.ToDecimal(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToDecimal(IFormatProvider).

IConvertible.ToDouble(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToDouble(IFormatProvider).

IConvertible.ToInt16(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToInt16(IFormatProvider).

IConvertible.ToInt32(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToInt32(IFormatProvider).

IConvertible.ToInt64(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToInt64(IFormatProvider).

IConvertible.ToSByte(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToSByte(IFormatProvider).

IConvertible.ToSingle(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToSingle(IFormatProvider).

IConvertible.ToType(Type, IFormatProvider)

Pour obtenir une description de ce membre, consultez ToType(Type, IFormatProvider).

IConvertible.ToUInt16(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToUInt16(IFormatProvider).

IConvertible.ToUInt32(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToUInt32(IFormatProvider).

IConvertible.ToUInt64(IFormatProvider)

Pour obtenir une description de ce membre, consultez ToUInt64(IFormatProvider).

IDecrementOperators<Int64>.CheckedDecrement(Int64)

Décrémente une valeur.

IDecrementOperators<Int64>.Decrement(Int64)

Décrémente une valeur.

IDivisionOperators<Int64,Int64,Int64>.Division(Int64, Int64)

Divise une valeur par une autre pour calculer leur quotient.

IEqualityOperators<Int64,Int64,Boolean>.Equality(Int64, Int64)

Compare deux valeurs pour déterminer l’égalité.

IEqualityOperators<Int64,Int64,Boolean>.Inequality(Int64, Int64)

Compare deux valeurs pour déterminer l’inégalité.

IIncrementOperators<Int64>.CheckedIncrement(Int64)

Incrémente une valeur.

IIncrementOperators<Int64>.Increment(Int64)

Incrémente une valeur.

IMinMaxValue<Int64>.MaxValue

Obtient la valeur maximale du type actuel.

IMinMaxValue<Int64>.MinValue

Obtient la valeur minimale du type actuel.

IModulusOperators<Int64,Int64,Int64>.Modulus(Int64, Int64)

Divise deux valeurs ensemble pour calculer leur module ou leur reste.

IMultiplicativeIdentity<Int64,Int64>.MultiplicativeIdentity

Obtient l’identité multiplicative du type actuel.

IMultiplyOperators<Int64,Int64,Int64>.CheckedMultiply(Int64, Int64)

Multiplie deux valeurs ensemble pour calculer leur produit.

IMultiplyOperators<Int64,Int64,Int64>.Multiply(Int64, Int64)

Multiplie deux valeurs ensemble pour calculer leur produit.

INumber<Int64>.MaxNumber(Int64, Int64)

Compare deux valeurs au calcul qui est supérieure et retourne l’autre valeur si une entrée est NaN.

INumber<Int64>.MinNumber(Int64, Int64)

Compare deux valeurs au calcul, ce qui est inférieur et retourne l’autre valeur si une entrée est NaN.

INumberBase<Int64>.IsCanonical(Int64)

Détermine si une valeur se trouve dans sa représentation canonique.

INumberBase<Int64>.IsComplexNumber(Int64)

Détermine si une valeur représente un nombre complexe.

INumberBase<Int64>.IsFinite(Int64)

Détermine si une valeur est finie.

INumberBase<Int64>.IsImaginaryNumber(Int64)

Détermine si une valeur représente un nombre imaginaire pur.

INumberBase<Int64>.IsInfinity(Int64)

Détermine si une valeur est infinie.

INumberBase<Int64>.IsInteger(Int64)

Détermine si une valeur représente un nombre intégral.

INumberBase<Int64>.IsNaN(Int64)

Détermine si une valeur est NaN.

INumberBase<Int64>.IsNegativeInfinity(Int64)

Détermine si une valeur est l’infini négatif.

INumberBase<Int64>.IsNormal(Int64)

Détermine si une valeur est normale.

INumberBase<Int64>.IsPositiveInfinity(Int64)

Détermine si une valeur est l’infini positif.

INumberBase<Int64>.IsRealNumber(Int64)

Détermine si une valeur représente un nombre réel.

INumberBase<Int64>.IsSubnormal(Int64)

Détermine si une valeur est subnormale.

INumberBase<Int64>.IsZero(Int64)

Détermine si une valeur est égale à zéro.

INumberBase<Int64>.MaxMagnitudeNumber(Int64, Int64)

Compare deux valeurs au calcul qui a la plus grande magnitude et retourne l’autre valeur si une entrée est NaN.

INumberBase<Int64>.MinMagnitudeNumber(Int64, Int64)

Compare deux valeurs au calcul dont la magnitude est inférieure et retourne l’autre valeur si une entrée est NaN.

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

Calcule une estimation de (left * right) + addend.

INumberBase<Int64>.One

Obtient la valeur 1 du type.

INumberBase<Int64>.Radix

Obtient le radix, ou la base, pour le type.

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

Représente un entier signé 64 bits.

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

Représente un entier signé 64 bits.

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

Représente un entier signé 64 bits.

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

Tente de convertir une instance du type actuel en un autre type, lève une exception de dépassement de capacité pour toutes les valeurs qui se trouvent en dehors de la plage représentée du type actuel.

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

Tente de convertir une instance du type actuel en un autre type, en saturant toutes les valeurs qui se trouvent en dehors de la plage représentée du type actuel.

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

Tente de convertir une instance du type actuel en un autre type, en tronqué toutes les valeurs qui se trouvent en dehors de la plage représentée du type actuel.

INumberBase<Int64>.Zero

Obtient la valeur 0 du type.

IShiftOperators<Int64,Int32,Int64>.LeftShift(Int64, Int32)

Déplace une valeur vers la gauche d’un montant donné.

IShiftOperators<Int64,Int32,Int64>.RightShift(Int64, Int32)

Déplace une valeur à droite d’un montant donné.

IShiftOperators<Int64,Int32,Int64>.UnsignedRightShift(Int64, Int32)

Déplace une valeur à droite d’un montant donné.

ISignedNumber<Int64>.NegativeOne

Obtient la valeur -1 du type.

ISubtractionOperators<Int64,Int64,Int64>.CheckedSubtraction(Int64, Int64)

Soustrait deux valeurs pour calculer leur différence.

ISubtractionOperators<Int64,Int64,Int64>.Subtraction(Int64, Int64)

Soustrait deux valeurs pour calculer leur différence.

IUnaryNegationOperators<Int64,Int64>.CheckedUnaryNegation(Int64)

Calcule la négation unaire vérifiée d’une valeur.

IUnaryNegationOperators<Int64,Int64>.UnaryNegation(Int64)

Calcule la négation unaire d’une valeur.

IUnaryPlusOperators<Int64,Int64>.UnaryPlus(Int64)

Calcule le plus unaire d’une valeur.

S’applique à

Cohérence de thread

Tous les membres de ce type sont thread safe. Les membres qui semblent modifier l’état de l’instance retournent réellement une nouvelle instance initialisée avec la nouvelle valeur. Comme pour tout autre type, la lecture et l’écriture dans une variable partagée qui contient une instance de ce type doit être protégée par un verrou pour garantir la sécurité des threads.

Voir aussi