Site icon Learn C++

What Are The Macros For The Integer Constants In Modern C++

What Are The Macros For The Integer Constants In Modern C++

In C++ programming, there are macros for the fixed-width integer type that allow you to obtain minimum and maximum possible values. In this post, we explain these macros for integer constants in modern C++.

What are the macros for minimum signed integer constants in modern C++?

Here are the macros for minimum signed integer constants in general form in C++:

Integer Constant Description
INT8_MINmin. value of 8 bits signed integer type
INT16_MINmin. value of 16 bits signed integer type
INT32_MINmin. value of 32 bits signed integer type
INT64_MINmin. value of 64 bits signed integer type

Here are the macros for minimum signed integer constants in fastest form:

Integer ConstantDescription
INT_FAST8_MINmin. value of 8 bits fast signed integer type
INT_FAST16_MINmin. value of 16 bits fast signed integer type
INT_FAST32_MINmin. value of 32 bits fast signed integer type
INT_FAST64_MINmin. value of 64 bits fast signed integer type

Here are the macros for minimum signed integer constants in smallest form:

Integer ConstantDescription
INT_LEAST8_MINmin. value of 8 bits fast signed integer type
INT_LEAST16_MINmin. value of 16 bits fast signed integer type
INT_LEAST32_MINmin. value of 32 bits fast signed integer type
INT_LEAST64_MINmin. value of 64 bits fast signed integer type
Integer ConstantDescription
INTMAX_MINmin. value of std::intmax_t
Integer ConstantDescription
INTPTR_MINmin. value of  std::intptr_t

What are the macros for the maximum signed integer constants in modern C++?

Here are the macros for maximum signed integer constants in general form in C++:

Integer ConstantDescription
INT8_MAXmax. value of 8 bits signed integer type
INT16_MAXmax. value of 16 bits signed integer type
INT32_MAXmax. value of 32 bits signed integer type
INT64_MAXmax. value of 64 bits signed integer type

Here are the macros for maximum signed integer constants in fastest form:

Integer ConstantDescription
INT_FAST8_MAXmax. value of 8 bits fast signed integer type
INT_FAST16_MAXmax. value of 16 bits fast signed integer type
INT_FAST32_MAXmax. value of 32 bits fast signed integer type
INT_FAST64_MAXmax. value of 64 bits fast signed integer type

Here are the macros for maximum signed integer constants in smallest form:

Integer ConstantDescription
INT_LEAST8_MAXmax. value of 8 bits fast signed integer type
INT_LEAST16_MAXmax. value of 16 bits fast signed integer type
INT_LEAST32_MAXmax. value of 32 bits fast signed integer type
INT_LEAST64_MAXmax. value of 64 bits fast signed integer type
Integer ConstantDescription
INTMAX_MAXmax. value of std::intmax_t
Integer ConstantDescription
INTPTR_MAXmax. value of  std::intptr_t

What are the macros for the minimum unsigned integer constants in modern C++?

Here are the macros for the minimum unsigned integer constants in general form in C++:

Integer ConstantDescription
UINT8_MINmin. value of 8 bits unsigned integer type
UINT16_MINmin. value of 16 bits unsigned integer type
UINT32_MINmin. value of 32 bits unsigned integer type
UINT64_MINmin. value of 64 bits unsigned integer type

Here are the macros for minimum unsigned integer constants in fastest form:

Integer ConstantDescription
UINT_FAST8_MINmin. value of 8 bits fast unsigned integer type
UINT_FAST16_MINmin. value of 16 bits fast unsigned integer type
UINT_FAST32_MINmin. value of 32 bits fast unsigned integer type
UINT_FAST64_MINmin. value of 64 bits fast unsigned integer type

Here are the macros for minimum unsigned integer constants in smallest form:

Integer ConstantDescription
UINT_LEAST8_MINmin. value of 8 bits fast unsigned integer type
UINT_LEAST16_MINmin. value of 16 bits fast unsigned integer type
UINT_LEAST32_MINmin. value of 32 bits fast unsigned integer type
UINT_LEAST64_MINmin. value of 64 bits fast unsigned integer type
Integer ConstantDescription
UINTMAX_MINmin. value of std::uintmax_t
Integer ConstantDescription
UINTPTR_MINmin. value of  std::uintptr_t

What are the macros for the maximum unsigned integer constants in modern C++?+

Here are the macros for the maximum signed integer constants in general form in C++.

Integer ConstantDescription
UINT8_MAXmax. value of 8 bits unsigned integer type
UINT16_MAXmax. value of 16 bits unsigned integer type
UINT32_MAXmax. value of 32 bits unsigned integer type
UINT64_MAXmax. value of 64 bits unsigned integer type

Here are the macros for the maximum unsigned integer constants in fastest form:

Integer ConstantDescription
UINT_FAST8_MAXmax. value of 8 bits fast unsigned integer type
UINT_FAST16_MAXmax. value of 16 bits fast unsigned integer type
UINT_FAST32_MAXmax. value of 32 bits fast unsigned integer type
UINT_FAST64_MAXmax. value of 64 bits fast unsigned integer type

Here are the macros for maximum unsigned integer constants in smallest form:

Integer ConstantDescription
UINT_LEAST8_MAXmax. value of 8 bits fast unsigned integer type
UINT_LEAST16_MAXmax. value of 16 bits fast unsigned integer type
UINT_LEAST32_MAXmax. value of 32 bits fast unsigned integer type
UINT_LEAST64_MAXmax. value of 64 bits fast unsigned integer type
Integer ConstantDescription
UINTMAX_MAXmax. value of std::uintmax_t
Integer ConstantDescription
UINTPTR_MAXmax. value of  std::uintptr_t

If you are looking more about Declared Constants, you can follow this link: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Declared_Constants

C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, MacOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for cross-platform UIs.

Exit mobile version