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

十年热恋 提交于 2019-12-03 23:34:27
Unknown

Yes.

int.MaxValue: 2,147,483,647

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

Daniel LeCheminant

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.

int is just an alias for Int32 - it's defined in the C# specification. Therefore int.MaxValue is the same as Int32.MaxValue which will always be 2147483647.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!