2

I opened "stdint.h" file from visual studio 2015 and as shown in below image, I noticed the INT_FAST16_MAX is defined to INT32_MAX. And same with unsigned too. Why is it so?

enter image description here

But the least ones are defined as expected. (below)

#define INT_LEAST16_MAX  INT16_MAX
#define UINT_LEAST16_MAX UINT16_MAX
Pavan Chandaka
  • 11,671
  • 5
  • 26
  • 34

1 Answers1

8

INT_FAST16_MAX is the largest value that can be stored in an int_fast16_t variable.

int_fast16_t is guaranteed to be the fastest int with a size of at least 16 bits.

Because MSVC is targeting machines that have 32-bit general purpose registers which are faster to access than 16-bit, int_fast16_t is actually a 32-bit integer. And thus, INT_FAST16_MAX is INT32_MAX.

See also:

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328