What is the int.MaxValue on a 64-bit PC?


Question

System.Console.WriteLine(int.MaxValue);

This line gives me the answer of 2,147,483,647 as I have a 32-bit PC.

Will the answer be same on a 64-bit PC?

1
26
8/16/2019 1:58:02 AM

Accepted Answer

Yes.

int.MaxValue: 2,147,483,647

Source: https://www.dotnetperls.com/int-maxvalue

20
9/18/2017 4:09:14 PM

Yes, the answer will be the same on a 64-bit machine.

In .NET, an int is a signed 32-bit integer, regardless of the processor. Its .NET framework type is System.Int32.

The C# Language specification states:

The int type represents signed 32-bit integers with values between –2,147,483,648 and 2,147,483,647.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon