Skip to content

nint and nuint types Constants specifies range for 32-bit process #24287

Open
@gfoidl

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.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions