climits


1. Checking Size of Integer Types

#include <climits>

int main() {
  // Print the minimum and maximum values of different integer types
  std::cout << "int: " << INT_MIN << " to " << INT_MAX << std::endl;
  std::cout << "short: " << SHRT_MIN << " to " << SHRT_MAX << std::endl;
  std::cout << "long: " << LONG_MIN << " to " << LONG_MAX << std::endl;
  std::cout << "long long: " << LLONG_MIN << " to " << LLONG_MAX << std::endl;
  return 0;
}

2. Checking Size of Float Types

#include <climits>

int main() {
  // Print the minimum and maximum values of float and double
  std::cout << "float: " << FLT_MIN << " to " << FLT_MAX << std::endl;
  std::cout << "double: " << DBL_MIN << " to " << DBL_MAX << std::endl;
  return 0;
}

3. Checking Floating-Point Precision

4. Checking Integer Overflow and Underflow

5. Checking Floating-Point Overflow and Underflow

6. Checking Minimum and Maximum Digits

7. Checking Sizes of Other Types

8. Checking Precision of Long Double

9. Checking Maximum Integer Divisor

10. Checking Maximum Float Divisor

11. Checking Maximum Double Divisor

12. Checking Signed and Unsigned Integer Sizes

13. Checking Maximum Size of an Array

14. Checking Minimum and Maximum Bits

15. Checking Maximum and Minimum Characters

16. Checking Unsigned Integer Comparison