C++C++11C++14C++17C++20Introduction to C++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

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

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.

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
Artificial Intelligence TechC++C++17C++20Learn C++

How To Create Simple Generative AI Code In C++

C++C++17Language FeatureLearn C++

How To Use The SVG Image Format With Skia In C++ Builder

C++C++17Language FeatureLearn C++

How To Use Skia Images in C++ Builder?

C++C++17Code SnippetGame DevelopmentLanguage FeatureLearn C++

What Is Skia In Modern C++?