What is the difference between the int types int8_t
, int_least8_t
and int_fast8_t
?
From the spec section 7.8.1.1 Exact-width integer types, paragraph 1:
The typedef name
int
N_t
designates a signed integer type with width N , no padding bits, and a two’s complement representation. Thus,int8_t
denotes a signed integer type with a width of exactly 8 bits.
And from: 7.18.1.2 Minimum-width integer types, paragraph 1:
The typedef name
int_least
N_t
designates a signed integer type with a width of at least N, such that no signed integer type with lesser size has at least the specified width. Thus,int_least32_t
denotes a signed integer type with a width of at least 32 bits.
And finally from 7.18.1.3 Fastest minimum-width integer types, paragraph 2:
The typedef name
int_fast
N_t
designates the fastest signed integer type with a width of at least N. The typedef nameuint_fast
N_t
designates the fastest unsigned integer type with a width of at least N.