System.Int64 Structure

Represents a 64-bit signed integer.

See Also: Int64

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public struct Int64 : IComparable, IComparable<long>, IConvertible, IEquatable<long>, IFormattable

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.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0

The members of System.Int64 are listed below.

See Also: ValueType

Public Fields

const
MaxValueInt64 (9223372036854775807).

Represents the largest possible value of an Int64. This field is constant.

const
MinValueInt64 (-9223372036854775808).

Represents the smallest possible value of an Int64. This field is constant.

Public Methods

CompareTo(Int64) : Int32

Compares this instance to a specified 64-bit signed integer and returns an indication of their relative values.

CompareTo(Object) : Int32

Compares this instance to a specified object and returns an indication of their relative values.

Equals(Int64) : Boolean

Returns a value indicating whether this instance is equal to a specified Int64 value.

override
Equals(Object) : Boolean

Returns a value indicating whether this instance is equal to a specified object.

override
GetHashCode() : Int32

Returns the hash code for this instance.

GetTypeCode() : TypeCode

Returns the TypeCode for value type Int64.

static
Parse(String) : Int64

Converts the string representation of a number to its 64-bit signed integer equivalent.

static
Parse(String, NumberStyles) : Int64

Converts the string representation of a number in a specified style to its 64-bit signed integer equivalent.

static
Parse(String, IFormatProvider) : Int64

Converts the string representation of a number in a specified culture-specific format to its 64-bit signed integer equivalent.

static
Parse(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.

override
ToString() : String

Converts the numeric value of this instance to its equivalent string representation.

ToString(IFormatProvider) : String

Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

ToString(String) : String

Converts the numeric value of this instance to its equivalent string representation, using the specified format.

ToString(String, IFormatProvider) : String

Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.

static
TryParse(String, out Int64) : Boolean
static
TryParse(String, NumberStyles, IFormatProvider, out Int64) : Boolean

Explicitly Implemented Interface Members

Int64$IConvertible.ToBoolean(IFormatProvider)

For a description of this member, see IConvertible.ToBoolean(IFormatProvider).

Int64$IConvertible.ToByte(IFormatProvider)

For a description of this member, see IConvertible.ToByte(IFormatProvider).

Int64$IConvertible.ToChar(IFormatProvider)

For a description of this member, see IConvertible.ToChar(IFormatProvider).

Int64$IConvertible.ToDateTime(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

Int64$IConvertible.ToDecimal(IFormatProvider)

For a description of this member, see IConvertible.ToDecimal(IFormatProvider).

Int64$IConvertible.ToDouble(IFormatProvider)

For a description of this member, see IConvertible.ToDouble(IFormatProvider).

Int64$IConvertible.ToInt16(IFormatProvider)

For a description of this member, see IConvertible.ToInt16(IFormatProvider).

Int64$IConvertible.ToInt32(IFormatProvider)

For a description of this member, see IConvertible.ToInt32(IFormatProvider).

Int64$IConvertible.ToInt64(IFormatProvider)

For a description of this member, see IConvertible.ToInt64(IFormatProvider).

Int64$IConvertible.ToSByte(IFormatProvider)

For a description of this member, see IConvertible.ToSByte(IFormatProvider).

Int64$IConvertible.ToSingle(IFormatProvider)

For a description of this member, see IConvertible.ToSingle(IFormatProvider).

Int64$IConvertible.ToType(Type,IFormatProvider)

For a description of this member, see IConvertible.ToType(Type,IFormatProvider).

Int64$IConvertible.ToUInt16(IFormatProvider)

For a description of this member, see IConvertible.ToUInt16(IFormatProvider).

Int64$IConvertible.ToUInt32(IFormatProvider)

For a description of this member, see IConvertible.ToUInt32(IFormatProvider).

Int64$IConvertible.ToUInt64(IFormatProvider)

For a description of this member, see IConvertible.ToUInt64(IFormatProvider).