Int64 Estrutura
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Representa um inteiro com sinal de 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
- Herança
- Atributos
- Implementações
-
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>
Observações
Int64 é um tipo de valor imutável que representa inteiros assinados com valores que variam de 9.223.372.036.854.775.808 negativos (que são representados pela constante de Int64.MinValue) até 9.223.372.036.854.775.807 positivos (que são representados pela constante Int64.MaxValue). O .NET também inclui um tipo de valor inteiro de 64 bits não assinado, UInt64, que representa valores que variam de 0 a 18.446.744.073.709.551.615.
Instanciar um valor Int64
Você pode instanciar um valor de Int64 de várias maneiras:
Você pode declarar uma variável Int64 e atribuir-lhe um valor inteiro literal que esteja dentro do intervalo do tipo de dados Int64. O exemplo a seguir declara duas variáveis Int64 e atribui-lhes valores dessa maneira.
long number1 = -64301728; long number2 = 255486129307;let number1 = -64301728L let number2 = 255486129307LDim number1 As Long = -64301728 Dim number2 As Long = 255486129307Você pode atribuir o valor de um tipo integral cujo intervalo é um subconjunto do tipo Int64. Esta é uma conversão de ampliação que não requer um operador cast em C# ou um método de conversão no Visual Basic. Em F#, apenas o tipo Int32 pode ser ampliado automaticamente.
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 = value3Dim 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 = value3Você pode atribuir o valor de um tipo numérico cujo intervalo excede o do tipo Int64. Esta é uma conversão de estreitamento, portanto, requer um operador cast em C# ou F# e um método de conversão no Visual Basic se
Option Strictestiver ativado. Se o valor numérico for um valor Single, Doubleou Decimal que inclua um componente fracionário, a manipulação de sua parte fracionária dependerá do compilador que executa a conversão. O exemplo a seguir executa conversões de estreitamento para atribuir vários valores numéricos a Int64 variáveis.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.Você pode chamar um método da classe Convert para converter qualquer tipo suportado em um valor Int64. Isso é possível porque Int64 suporta a interface IConvertible. O exemplo a seguir ilustra a conversão de uma matriz de valores de Decimal em valores 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.Você pode chamar o método Parse ou TryParse para converter a representação de cadeia de caracteres de um valor Int64 em um Int64. A cadeia de caracteres pode conter dígitos decimais ou hexadecimais. O exemplo a seguir ilustra a operação de análise usando uma cadeia decimal e uma cadeia hexadecimal.
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 // 67012198154let 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 // 67012198154Dim 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
Executar operações em valores Int64
O tipo Int64 suporta operações matemáticas padrão, como adição, subtração, divisão, multiplicação, negação e negação unária. Como os outros tipos integrais, o tipo Int64 também suporta os operadores bitwise AND, OR, XOR, deslocamento à esquerda e deslocamento à direita.
Você pode usar os operadores numéricos padrão para comparar dois valores Int64 ou pode chamar o método CompareTo ou Equals.
Você também pode chamar os membros da classe Math para executar uma ampla gama de operações numéricas, incluindo obter o valor absoluto de um número, calcular o quociente e o restante da divisão integral, determinar o valor máximo ou mínimo de dois inteiros longos, obter o sinal de um número e arredondar um número.
Representar um Int64 como uma cadeia de caracteres
O tipo Int64 fornece suporte total para cadeias de caracteres de formato numérico padrão e personalizado. (Para obter mais informações, consulte Tipos de formatação, Cadeias de caracteres de formato numérico padrãoe Cadeias de caracteres de formato numérico personalizado.)
Para formatar um valor Int64 como uma cadeia de caracteres integral sem zeros à esquerda, você pode chamar o método ToString() sem parâmetros. Usando o especificador de formato "D", você também pode incluir um número especificado de zeros à esquerda na representação da cadeia de caracteres. Usando o especificador de formato "N", você pode incluir separadores de grupo e especificar o número de dígitos decimais a serem exibidos na representação de cadeia de caracteres do número. Usando o especificador de formato "X", você pode representar um valor Int64 como uma cadeia de caracteres hexadecimal. O exemplo a seguir formata os elementos em um array de valores de Int64 de quatro maneiras diferentes.
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
Você também pode formatar um valor Int64 como uma cadeia de caracteres binária, octal, decimal ou hexadecimal chamando o método ToString(Int64, Int32) e fornecendo a base como o segundo parâmetro do método. O exemplo a seguir chama esse método para exibir as representações binárias, octais e hexadecimais de uma matriz de valores inteiros.
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
Trabalhar com valores inteiros de 64 bits não decimais
Além de trabalhar com inteiros longos individuais como valores decimais, convém executar operações bit a bit ou trabalhar com representações binárias ou hexadecimais de valores inteiros longos. Int64 valores são representados em 63 bits, com o sexagésimo quarto bit usado como um bit de sinal. Os valores positivos são representados usando representação de sinal e magnitude. Os valores negativos estão na representação do complemento de dois. Isso é importante ter em mente quando você executa operações bit a bit em valores Int64 ou quando trabalha com bits individuais. Para executar uma operação numérica, booleana ou de comparação em quaisquer dois valores não decimais, ambos os valores devem usar a mesma representação.
Campos
| Name | Descrição |
|---|---|
| MaxValue |
Representa o maior valor possível de um Int64. Este campo é constante. |
| MinValue |
Representa o menor valor possível de um Int64. Este campo é constante. |
Métodos
| Name | Descrição |
|---|---|
| Abs(Int64) |
Calcula o absoluto de um valor. |
| BigMul(Int64, Int64) |
Produz o produto completo de dois números de 64 bits. |
| Clamp(Int64, Int64, Int64) |
Fixa um valor a um valor mínimo e máximo inclusivo. |
| CompareTo(Int64) |
Compara esta instância com um inteiro com assinatura especificado de 64 bits e devolve uma indicação dos seus valores relativos. |
| CompareTo(Object) |
Compara esta instância com um objeto especificado e devolve uma indicação dos seus valores relativos. |
| CopySign(Int64, Int64) |
Copia o sinal de um valor para o sinal de outro valor. |
| CreateChecked<TOther>(TOther) |
Cria uma instância do tipo atual a partir de um valor, lançando uma exceção de overflow para quaisquer valores que estejam fora do intervalo representável do tipo atual. |
| CreateSaturating<TOther>(TOther) |
Cria uma instância do tipo atual a partir de um valor, saturando quaisquer valores que estejam fora do intervalo representável do tipo atual. |
| CreateTruncating<TOther>(TOther) |
Cria uma instância do tipo atual a partir de um valor, truncando quaisquer valores que estejam fora do intervalo representável do tipo atual. |
| DivRem(Int64, Int64) |
Calcula o quociente e o resto de dois valores. |
| Equals(Int64) |
Devolve um valor que indica se esta instância é igual a um valor especificado Int64 . |
| Equals(Object) |
Devolve um valor que indica se esta instância é igual a um objeto especificado. |
| GetHashCode() |
Devolve o código de hash para esta instância. |
| GetTypeCode() | |
| IsEvenInteger(Int64) |
Determina se um valor representa um número inteiro par. |
| IsNegative(Int64) |
Determina se um valor é negativo. |
| IsOddInteger(Int64) |
Determina se um valor representa um número inteiro ímpar. |
| IsPositive(Int64) |
Determina se um valor é positivo. |
| IsPow2(Int64) |
Determina se um valor é uma potência de dois. |
| LeadingZeroCount(Int64) |
Calcula o número de zeros à esquerda num valor. |
| Log10(Int64) |
Representa um inteiro com sinal de 64 bits. |
| Log2(Int64) |
Calcula o log2 de um valor. |
| Max(Int64, Int64) |
Compara dois valores para calcular qual é maior. |
| MaxMagnitude(Int64, Int64) |
Compara dois valores para calcular qual é maior. |
| Min(Int64, Int64) |
Compara dois valores para calcular qual é menor. |
| MinMagnitude(Int64, Int64) |
Compara dois valores para calcular qual é menor. |
| Parse(ReadOnlySpan<Byte>, IFormatProvider) |
Analisa um intervalo de caracteres UTF-8 num valor. |
| Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider) |
Analisa um intervalo de caracteres UTF-8 num valor. |
| Parse(ReadOnlySpan<Char>, IFormatProvider) |
Divide um intervalo de caracteres num valor. |
| Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
Converte a representação span de um número num estilo especificado e formato específico de cultura para o seu equivalente inteiro com sinal de 64 bits. |
| Parse(String, IFormatProvider) |
Converte a representação da cadeia de um número num formato específico de cultura para o seu equivalente inteiro com sinal de 64 bits. |
| Parse(String, NumberStyles, IFormatProvider) |
Converte a representação em cadeia de um número num estilo especificado e formato específico de cultura para o seu equivalente inteiro com sinal de 64 bits. |
| Parse(String, NumberStyles) |
Converte a representação da cadeia de um número num estilo especificado para o seu equivalente inteiro com sinal de 64 bits. |
| Parse(String) |
Converte a representação da cadeia de um número para o seu equivalente inteiro com sinal de 64 bits. |
| PopCount(Int64) |
Calcula o número de bits que estão definidos num valor. |
| RotateLeft(Int64, Int32) |
Roda um valor deixado por uma determinada quantia. |
| RotateRight(Int64, Int32) |
Roda um valor exatamente por uma determinada quantia. |
| Sign(Int64) |
Calcula o sinal de um valor. |
| ToString() |
Converte o valor numérico desta instância para a sua representação equivalente em cadeias. |
| ToString(IFormatProvider) |
Converte o valor numérico desta instância para a sua representação equivalente de cadeias usando a informação de formato específica da cultura especificada. |
| ToString(String, IFormatProvider) |
Converte o valor numérico desta instância para a sua representação equivalente de cadeias usando o formato especificado e a informação específica de formato da cultura. |
| ToString(String) |
Converte o valor numérico desta instância para a sua representação equivalente em cadeias, usando o formato especificado. |
| TrailingZeroCount(Int64) |
Calcula o número de zeros finais num valor. |
| TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Tenta formatar o valor da instância atual como UTF-8 no intervalo fornecido de bytes. |
| TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Tenta formatar o valor da instância atual do número longo no intervalo fornecido de caracteres. |
| TryParse(ReadOnlySpan<Byte>, IFormatProvider, Int64) |
Tenta separar um intervalo de caracteres UTF-8 num valor. |
| TryParse(ReadOnlySpan<Byte>, Int64) |
Tenta converter um intervalo de caracteres UTF-8 contendo a representação da cadeia de um número para o seu equivalente inteiro assinado de 64 bits. |
| TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, Int64) |
Tenta separar um intervalo de caracteres UTF-8 num valor. |
| TryParse(ReadOnlySpan<Char>, IFormatProvider, Int64) |
Tenta separar um intervalo de caracteres num valor. |
| TryParse(ReadOnlySpan<Char>, Int64) |
Converte a representação em expansão de um número para o seu equivalente inteiro com sinal de 64 bits. Um valor de retorno indica se a conversão teve sucesso ou falhou. |
| TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Int64) |
Converte a representação span de um número num estilo especificado e formato específico de cultura para o seu equivalente inteiro com sinal de 64 bits. Um valor de retorno indica se a conversão teve sucesso ou falhou. |
| TryParse(String, IFormatProvider, Int64) |
Tenta analisar uma cadeia num valor. |
| TryParse(String, Int64) |
Converte a representação da cadeia de um número para o seu equivalente inteiro com sinal de 64 bits. Um valor de retorno indica se a conversão teve sucesso ou falhou. |
| TryParse(String, NumberStyles, IFormatProvider, Int64) |
Converte a representação em cadeia de um número num estilo especificado e formato específico de cultura para o seu equivalente inteiro com sinal de 64 bits. Um valor de retorno indica se a conversão teve sucesso ou falhou. |
Implementações de Interface Explícita
| Name | Descrição |
|---|---|
| IAdditionOperators<Int64,Int64,Int64>.Addition(Int64, Int64) |
Soma dois valores para calcular a sua soma. |
| IAdditionOperators<Int64,Int64,Int64>.CheckedAddition(Int64, Int64) |
Soma dois valores para calcular a sua soma. |
| IAdditiveIdentity<Int64,Int64>.AdditiveIdentity |
Obtém a identidade aditiva do tipo atual. |
| IBinaryInteger<Int64>.GetByteCount() |
Obtém o número de bytes que serão escritos como parte de TryWriteLittleEndian(Span<Byte>, Int32). |
| IBinaryInteger<Int64>.GetShortestBitLength() |
Obtém o comprimento, em bits, da representação do complemento dos dois mais curtos do valor atual. |
| IBinaryInteger<Int64>.TryReadBigEndian(ReadOnlySpan<Byte>, Boolean, Int64) |
Representa um inteiro com sinal de 64 bits. |
| IBinaryInteger<Int64>.TryReadLittleEndian(ReadOnlySpan<Byte>, Boolean, Int64) |
Representa um inteiro com sinal de 64 bits. |
| IBinaryInteger<Int64>.TryWriteBigEndian(Span<Byte>, Int32) |
Tenta escrever o valor atual, em formato big-endian, para um determinado intervalo. |
| IBinaryInteger<Int64>.TryWriteLittleEndian(Span<Byte>, Int32) |
Tenta escrever o valor atual, em formato little-endian, num determinado intervalo. |
| IBinaryNumber<Int64>.AllBitsSet |
Obtém uma instância do tipo binário em que todos os bits estão definidos. |
| IBitwiseOperators<Int64,Int64,Int64>.BitwiseAnd(Int64, Int64) |
Calcula o bit a bit de dois valores. |
| IBitwiseOperators<Int64,Int64,Int64>.BitwiseOr(Int64, Int64) |
Calcula o bit-or-ou de dois valores. |
| IBitwiseOperators<Int64,Int64,Int64>.ExclusiveOr(Int64, Int64) |
Calcula o ou exclusivo de dois valores. |
| IBitwiseOperators<Int64,Int64,Int64>.OnesComplement(Int64) |
Calcula a representação de um complemento de um dado valor. |
| IComparable.CompareTo(Object) |
Compara esta instância com um objeto especificado e devolve uma indicação dos seus valores relativos. |
| IComparisonOperators<Int64,Int64,Boolean>.GreaterThan(Int64, Int64) |
Compara dois valores para determinar qual é maior. |
| IComparisonOperators<Int64,Int64,Boolean>.GreaterThanOrEqual(Int64, Int64) |
Compara dois valores para determinar qual é maior ou igual. |
| IComparisonOperators<Int64,Int64,Boolean>.LessThan(Int64, Int64) |
Compara dois valores para determinar qual é menor. |
| IComparisonOperators<Int64,Int64,Boolean>.LessThanOrEqual(Int64, Int64) |
Compara dois valores para determinar qual é menor ou igual. |
| IConvertible.GetTypeCode() | |
| IConvertible.ToBoolean(IFormatProvider) |
Para uma descrição deste elemento, veja ToBoolean(IFormatProvider). |
| IConvertible.ToByte(IFormatProvider) |
Para uma descrição deste elemento, veja ToByte(IFormatProvider). |
| IConvertible.ToChar(IFormatProvider) |
Para uma descrição deste elemento, veja ToChar(IFormatProvider). |
| IConvertible.ToDateTime(IFormatProvider) |
Esta conversão não é suportada. Tentar usar este método lança um InvalidCastException. |
| IConvertible.ToDecimal(IFormatProvider) |
Para uma descrição deste elemento, veja ToDecimal(IFormatProvider). |
| IConvertible.ToDouble(IFormatProvider) |
Para uma descrição deste elemento, veja ToDouble(IFormatProvider). |
| IConvertible.ToInt16(IFormatProvider) |
Para uma descrição deste elemento, veja ToInt16(IFormatProvider). |
| IConvertible.ToInt32(IFormatProvider) |
Para uma descrição deste elemento, veja ToInt32(IFormatProvider). |
| IConvertible.ToInt64(IFormatProvider) |
Para uma descrição deste elemento, veja ToInt64(IFormatProvider). |
| IConvertible.ToSByte(IFormatProvider) |
Para uma descrição deste elemento, veja ToSByte(IFormatProvider). |
| IConvertible.ToSingle(IFormatProvider) |
Para uma descrição deste elemento, veja ToSingle(IFormatProvider). |
| IConvertible.ToType(Type, IFormatProvider) |
Para uma descrição deste elemento, veja ToType(Type, IFormatProvider). |
| IConvertible.ToUInt16(IFormatProvider) |
Para uma descrição deste elemento, veja ToUInt16(IFormatProvider). |
| IConvertible.ToUInt32(IFormatProvider) |
Para uma descrição deste elemento, veja ToUInt32(IFormatProvider). |
| IConvertible.ToUInt64(IFormatProvider) |
Para uma descrição deste elemento, veja ToUInt64(IFormatProvider). |
| IDecrementOperators<Int64>.CheckedDecrement(Int64) |
Diminui um valor. |
| IDecrementOperators<Int64>.Decrement(Int64) |
Diminui um valor. |
| IDivisionOperators<Int64,Int64,Int64>.Division(Int64, Int64) |
Divide um valor por outro para calcular o seu quociente. |
| IEqualityOperators<Int64,Int64,Boolean>.Equality(Int64, Int64) |
Compara dois valores para determinar a igualdade. |
| IEqualityOperators<Int64,Int64,Boolean>.Inequality(Int64, Int64) |
Compara dois valores para determinar a desigualdade. |
| IIncrementOperators<Int64>.CheckedIncrement(Int64) |
Incrementa um valor. |
| IIncrementOperators<Int64>.Increment(Int64) |
Incrementa um valor. |
| IMinMaxValue<Int64>.MaxValue |
Obtém o valor máximo do tipo atual. |
| IMinMaxValue<Int64>.MinValue |
Obtém o valor mínimo do tipo atual. |
| IModulusOperators<Int64,Int64,Int64>.Modulus(Int64, Int64) |
Divide dois valores para calcular o seu módulo ou resto. |
| IMultiplicativeIdentity<Int64,Int64>.MultiplicativeIdentity |
Obtém a identidade multiplicativa do tipo atual. |
| IMultiplyOperators<Int64,Int64,Int64>.CheckedMultiply(Int64, Int64) |
Multiplica dois valores juntos para calcular o seu produto. |
| IMultiplyOperators<Int64,Int64,Int64>.Multiply(Int64, Int64) |
Multiplica dois valores juntos para calcular o seu produto. |
| INumber<Int64>.MaxNumber(Int64, Int64) |
Compara dois valores para calcular qual é maior e devolve o outro valor se uma entrada for |
| INumber<Int64>.MinNumber(Int64, Int64) |
Compara dois valores para calcular qual é menor e devolve o outro valor se uma entrada for |
| INumberBase<Int64>.IsCanonical(Int64) |
Determina se um valor está na sua representação canónica. |
| INumberBase<Int64>.IsComplexNumber(Int64) |
Determina se um valor representa um número complexo. |
| INumberBase<Int64>.IsFinite(Int64) |
Determina se um valor é finito. |
| INumberBase<Int64>.IsImaginaryNumber(Int64) |
Determina se um valor representa um número puramente imaginário. |
| INumberBase<Int64>.IsInfinity(Int64) |
Determina se um valor é infinito. |
| INumberBase<Int64>.IsInteger(Int64) |
Determina se um valor representa um número inteiro. |
| INumberBase<Int64>.IsNaN(Int64) |
Determina se um valor é NaN. |
| INumberBase<Int64>.IsNegativeInfinity(Int64) |
Determina se um valor é menos infinito. |
| INumberBase<Int64>.IsNormal(Int64) |
Determina se um valor é normal. |
| INumberBase<Int64>.IsPositiveInfinity(Int64) |
Determina se um valor é infinito positivo. |
| INumberBase<Int64>.IsRealNumber(Int64) |
Determina se um valor representa um número real. |
| INumberBase<Int64>.IsSubnormal(Int64) |
Determina se um valor é subnormal. |
| INumberBase<Int64>.IsZero(Int64) |
Determina se um valor é zero. |
| INumberBase<Int64>.MaxMagnitudeNumber(Int64, Int64) |
Compara dois valores para calcular qual tem maior magnitude e devolve o outro valor se uma entrada for |
| INumberBase<Int64>.MinMagnitudeNumber(Int64, Int64) |
Compara dois valores para calcular que tem a magnitude menor e devolve o outro valor se uma entrada for |
| INumberBase<Int64>.MultiplyAddEstimate(Int64, Int64, Int64) |
Calcula uma estimativa de ( |
| INumberBase<Int64>.One |
Obtém o valor |
| INumberBase<Int64>.Radix |
Obtém a raiz, ou base, para o tipo. |
| INumberBase<Int64>.TryConvertFromChecked<TOther>(TOther, Int64) |
Representa um inteiro com sinal de 64 bits. |
| INumberBase<Int64>.TryConvertFromSaturating<TOther>(TOther, Int64) |
Representa um inteiro com sinal de 64 bits. |
| INumberBase<Int64>.TryConvertFromTruncating<TOther>(TOther, Int64) |
Representa um inteiro com sinal de 64 bits. |
| INumberBase<Int64>.TryConvertToChecked<TOther>(Int64, TOther) |
Tenta converter uma instância do tipo atual para outro tipo, lançando uma exceção de overflow para quaisquer valores que estejam fora do intervalo representável do tipo atual. |
| INumberBase<Int64>.TryConvertToSaturating<TOther>(Int64, TOther) |
Tenta converter uma instância do tipo atual para outro tipo, saturando quaisquer valores que estejam fora do intervalo representável do tipo atual. |
| INumberBase<Int64>.TryConvertToTruncating<TOther>(Int64, TOther) |
Tenta converter uma instância do tipo atual para outro tipo, truncando quaisquer valores que estejam fora do intervalo representável do tipo atual. |
| INumberBase<Int64>.Zero |
Obtém o valor |
| IShiftOperators<Int64,Int32,Int64>.LeftShift(Int64, Int32) |
Desloca um valor deixado por uma determinada quantia. |
| IShiftOperators<Int64,Int32,Int64>.RightShift(Int64, Int32) |
Desloca um valor para a direita numa determinada quantia. |
| IShiftOperators<Int64,Int32,Int64>.UnsignedRightShift(Int64, Int32) |
Desloca um valor para a direita numa determinada quantia. |
| ISignedNumber<Int64>.NegativeOne |
Obtém o valor |
| ISubtractionOperators<Int64,Int64,Int64>.CheckedSubtraction(Int64, Int64) |
Subtrai dois valores para calcular a sua diferença. |
| ISubtractionOperators<Int64,Int64,Int64>.Subtraction(Int64, Int64) |
Subtrai dois valores para calcular a sua diferença. |
| IUnaryNegationOperators<Int64,Int64>.CheckedUnaryNegation(Int64) |
Calcula a negação unária verificada de um valor. |
| IUnaryNegationOperators<Int64,Int64>.UnaryNegation(Int64) |
Calcula a negação unária de um valor. |
| IUnaryPlusOperators<Int64,Int64>.UnaryPlus(Int64) |
Calcula o plus unário de um valor. |
Aplica-se a
Segurança de Thread
Todos os membros deste tipo são seguros para fios. Os membros que parecem modificar o estado da instância retornam na verdade uma nova instância inicializada com o novo valor. Como em qualquer outro tipo, a leitura e escrita numa variável partilhada que contenha uma instância deste tipo deve ser protegida por um bloqueio para garantir a segurança do thread.