Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

620
Views
¿Existe una macro estándar en C o C++ que represente el valor máximo y mínimo de int32_t, int64_t?

¿Hay alguna macro en C o C++ que represente el valor máximo y mínimo de int32_t e int64_t? Sé que uno mismo puede definirlo literalmente, pero es mejor si hay una macro estándar. Tenga en cuenta que no estoy preguntando sobre el máximo de int, long, etc. pero intXX_t

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

En C++, hay std::numeric_limits::min() y std::numeric_limits::max() en el encabezado <limits> :

 std::cout << std::numeric_limits<std::int32_t>::min() << std::endl;

y así. En C, el encabezado <stdint.h> define INT32_MIN , INT32_MAX , etc. Estos también están disponibles en el encabezado C++ <cstdint> .

over 4 years ago · Santiago Trujillo Report

0

En C++ puede usar el encabezado <limits> y la clase std::numeric_limts declarada en este encabezado.

Para conocer los valores máximo y mínimo de los tipos int32_t e int64_t puedes escribir por ejemplo

 #include <cstdint> #include <limits> //... std::cout << std::numeric_limits<int32_t>::max() << std::endl; std::cout << std::numeric_limits<int32_t>::min() << std::endl; std::cout << std::numeric_limits<int64_t>::max() << std::endl; std::cout << std::numeric_limits<int64_t>::min() << std::endl;

En C, debe incluir el encabezado <stdint.h> y usar las macros correspondientes definidas en el encabezado, como por ejemplo

 INT32_MIN INT32_MAX INT64_MIN INT64_MAX
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!