nint
and nuint
types Constants specifies range for 32-bit process #24287
Open
Description
Section Constants says:
Constants
You can use constant values in the following ranges:
- For
nint
: Int32.MinValue to Int32.MaxValue.- For
nuint
: UInt32.MinValue to UInt32.MaxValue.
This is only correct for 32-bit processes.
As nint
and nuint
are native sized, so on 64-bit processes the range for nint
is Int64.MinValue
to Int64.MaxValue
.
Or generalized: the range is the same as for IntPtr
, so [IntPtr.MinSize, IntPtr.MaxSize]
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 71aa383e-70a4-855c-e639-c06c479f918e
- Version Independent ID: 7c19d234-b117-196d-d1a9-d29be9de5ff2
- Content: nint and nuint types - C# reference
- Content Source: docs/csharp/language-reference/builtin-types/nint-nuint.md
- Product: dotnet-csharp
- Technology: csharp-language-reference
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn