.NET Framework Class Library
Int64 Structure

Represents a 64-bit signed integer.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)
Syntax
<[%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_0%]> _
<[%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_1%](True)> _
Public Structure Int64 _
	Implements [%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_2%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_3%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_4%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_5%](Of Long),  _
	[%$TOPIC/6yy583ek_en-us_VS_110_1_0_0_0_6%](Of Long)
[[%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_0%]]
[[%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_1%](true)]
public struct Int64 : [%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_2%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_3%], 
	[%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_4%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_5%]<long>, [%$TOPIC/6yy583ek_en-us_VS_110_1_0_1_0_6%]<long>
[[%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_0%]]
[[%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_1%](true)]
public value class Int64 : [%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_2%], 
	[%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_3%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_4%], [%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_5%]<long long>, [%$TOPIC/6yy583ek_en-us_VS_110_1_0_2_0_6%]<long long>
[<[%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_0%]>]
[<[%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_1%]>]
[<[%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_2%](true)>]
type Int64 =  
    struct 
        interface [%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_3%] 
        interface [%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_4%] 
        interface [%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_5%] 
        interface [%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_6%]<int64>
        interface [%$TOPIC/6yy583ek_en-us_VS_110_1_0_3_0_7%]<int64>
    end

The Int64 type exposes the following members.

Methods
  NameDescription
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps CompareTo(Int64)Compares this instance to a specified 64-bit signed integer and returns an indication of their relative values.
Public method Supported by the XNA Framework CompareTo(Object)Compares this instance to a specified object and returns an indication of their relative values.
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps Equals(Int64)Returns a value indicating whether this instance is equal to a specified Int64 value.
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps Equals(Object)Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueTypeEquals(Object).)
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps GetHashCodeReturns the hash code for this instance. (Overrides ValueTypeGetHashCode.)
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method Supported by the XNA Framework GetTypeCodeReturns the TypeCode for value type Int64.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps Parse(String)Converts the string representation of a number to its 64-bit signed integer equivalent.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps Parse(String, NumberStyles)Converts the string representation of a number in a specified style to its 64-bit signed integer equivalent.
Public method Static member Supported by Portable Class Library Supported in .NET for Windows Store apps Parse(String, IFormatProvider)Converts the string representation of a number in a specified culture-specific format to its 64-bit signed integer equivalent.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps Parse(String, NumberStyles, IFormatProvider)Converts the string representation of a number in a specified style and culture-specific format to its 64-bit signed integer equivalent.
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps ToStringConverts the numeric value of this instance to its equivalent string representation. (Overrides ValueTypeToString.)
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps ToString(IFormatProvider)Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps ToString(String)Converts the numeric value of this instance to its equivalent string representation, using the specified format.
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps ToString(String, IFormatProvider)Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public method Static member Supported by Portable Class Library Supported in .NET for Windows Store apps TryParse(String, Int64)Converts the string representation of a number to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.
Public method Static member Supported by Portable Class Library Supported in .NET for Windows Store apps TryParse(String, NumberStyles, IFormatProvider, Int64)Converts the string representation of a number in a specified style and culture-specific format to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Fields
  NameDescription
Public field Static member Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps MaxValueRepresents the largest possible value of an Int64. This field is constant.
Public field Static member Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps MinValueRepresents the smallest possible value of an Int64. This field is constant.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implemetation Private method Supported by Portable Class Library Supported in .NET for Windows Store apps IComparableCompareToCompares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToBooleanInfrastructure. For a description of this member, see IConvertibleToBoolean.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToByteInfrastructure. For a description of this member, see IConvertibleToByte.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToCharInfrastructure. For a description of this member, see IConvertibleToChar.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToDateTimeInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToDecimalInfrastructure. For a description of this member, see IConvertibleToDecimal.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToDoubleInfrastructure. For a description of this member, see IConvertibleToDouble.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToInt16Infrastructure. For a description of this member, see IConvertibleToInt16.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToInt32Infrastructure. For a description of this member, see IConvertibleToInt32.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToInt64Infrastructure. For a description of this member, see IConvertibleToInt64.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToSByteInfrastructure. For a description of this member, see IConvertibleToSByte.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToSingleInfrastructure. For a description of this member, see IConvertibleToSingle.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToTypeInfrastructure. For a description of this member, see IConvertibleToType.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToUInt16Infrastructure. For a description of this member, see IConvertibleToUInt16.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToUInt32Infrastructure. For a description of this member, see IConvertibleToUInt32.
Explicit interface implemetation Private method Supported by the XNA Framework IConvertibleToUInt64Infrastructure. For a description of this member, see IConvertibleToUInt64.
Top
Remarks

The Int64 value type represents integers with values ranging from negative 9,223,372,036,854,775,808 through positive 9,223,372,036,854,775,807.

Int64 provides methods to compare instances of this type, to convert the value of an instance to its string representation, and to convert the string representation of a number to an instance of this type.

You can also call the members of the Math class to perform a wide range of numeric operations, including getting the absolute value of a number, calculating the quotient and remainder from integral division, determining the maximum or minimum value of two integers, getting the sign of a number, and rounding a number.

Version Information

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1
Platforms

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety

All members of this type are thread safe. Members that appear to modify instance state actually return a new instance initialized with the new value. As with any other type, reading and writing to a shared variable that contains an instance of this type must be protected by a lock to guarantee thread safety.

Caution noteCaution

Assigning an instance of this type is not thread safe on all hardware platforms because the binary representation of that instance might be too large to assign in a single atomic operation.