W3docs

Maximum and Minimum values for ints

In most modern programming languages, the maximum value for an int data type is implementation-specific, but is typically in the range of 2^31 - 1 to 2^63 - 1, and the minimum value is usually -2^31 or -2^63.

In most modern programming languages, the maximum value for an int data type is implementation-specific, but is typically in the range of 2^31 - 1 to 2^63 - 1, and the minimum value is usually -2^31 or -2^63. In C and C++, the INT_MAX and INT_MIN macros are defined in the <climits> header file, and can be used to determine the maximum and minimum values for the int data type on a particular platform.

For example, on most platforms (including 64-bit systems), int is 32 bits, yielding a range of -2147483648 to 2147483647. For 64-bit integers, C++ provides long long (or int64_t), which typically ranges from -9223372036854775808 to 9223372036854775807. Note that exact sizes depend on the compiler and platform ABI, not just the OS architecture. In Python, integers have arbitrary precision and do not have fixed maximum or minimum values.