nint Struct

Definition

Native signed integer (32-bit in 32-bit platforms, and 64-bit on 64-bit platforms)

[System.Serializable]
public struct nint : IComparable, IComparable<nint>, IConvertible, IEquatable<nint>, IFormattable
type nint = struct
    interface IFormattable
    interface IConvertible
Inheritance
nint
Attributes
Implements

Remarks

This data type is an integer value that uses the natural size of the host architecture to store its value.  On 32-bit systems, this uses T:System.Int32 for storage and on 64-bit systems it uses T:System.Int64 for storage.

As an optimization, the compiler and runtime have special knowledge of this data type, so while there is no dedicated set of IL instructions to deal with variable-size integer values, the runtime will transform uses of nint into their native underlying representation transparently.

This type is defined in lowercase because it makes it feel like a C# data type when used in C# source code.

Constructors

nint(Int32)
nint(Int64)

Fields

MaxValue
MinValue
Size

Methods

CompareTo(nint)
CompareTo(Object)
CopyArray(IntPtr, nint[], Int32, Int32)
CopyArray(nint[], Int32, IntPtr, Int32)
Equals(nint)
Equals(Object)
GetHashCode()
GetTypeCode()
Parse(String)
Parse(String, IFormatProvider)
Parse(String, NumberStyles)
Parse(String, NumberStyles, IFormatProvider)
ToString()
ToString(IFormatProvider)
ToString(String)
ToString(String, IFormatProvider)
TryParse(String, nint)
TryParse(String, NumberStyles, IFormatProvider, nint)

Operators

Addition(nint, nint)
BitwiseAnd(nint, nint)
BitwiseOr(nint, nint)
Decrement(nint)
Division(nint, nint)
Equality(nint, nint)
ExclusiveOr(nint, nint)
Explicit(Decimal to nint)
Explicit(Double to nint)
Explicit(Int64 to nint)
Explicit(IntPtr to nint)
Explicit(nfloat to nint)
Explicit(nint to Byte)
Explicit(nint to Char)
Explicit(nint to Int16)
Explicit(nint to Int32)
Explicit(nint to IntPtr)
Explicit(nint to nuint)
Explicit(nint to SByte)
Explicit(nint to UInt16)
Explicit(nint to UInt32)
Explicit(nint to UInt64)
Explicit(nuint to nint)
Explicit(Single to nint)
Explicit(UInt16 to nint)
Explicit(UInt32 to nint)
Explicit(UInt64 to nint)
GreaterThan(nint, nint)
GreaterThanOrEqual(nint, nint)
Implicit(Byte to nint)
Implicit(Char to nint)
Implicit(Int16 to nint)
Implicit(Int32 to nint)
Implicit(nint to Decimal)
Implicit(nint to Double)
Implicit(nint to Int64)
Implicit(nint to nfloat)
Implicit(nint to Single)
Implicit(SByte to nint)
Increment(nint)
Inequality(nint, nint)
LeftShift(nint, Int32)
LessThan(nint, nint)
LessThanOrEqual(nint, nint)
Modulus(nint, nint)
Multiply(nint, nint)
OnesComplement(nint)
RightShift(nint, Int32)
Subtraction(nint, nint)
UnaryNegation(nint)
UnaryPlus(nint)

Explicit Interface Implementations

IConvertible.ToBoolean(IFormatProvider)
IConvertible.ToByte(IFormatProvider)
IConvertible.ToChar(IFormatProvider)
IConvertible.ToDateTime(IFormatProvider)
IConvertible.ToDecimal(IFormatProvider)
IConvertible.ToDouble(IFormatProvider)
IConvertible.ToInt16(IFormatProvider)
IConvertible.ToInt32(IFormatProvider)
IConvertible.ToInt64(IFormatProvider)
IConvertible.ToSByte(IFormatProvider)
IConvertible.ToSingle(IFormatProvider)
IConvertible.ToType(Type, IFormatProvider)
IConvertible.ToUInt16(IFormatProvider)
IConvertible.ToUInt32(IFormatProvider)
IConvertible.ToUInt64(IFormatProvider)

Applies to