I saw in /usr/include/limits.h as
/* Minimum and maximum values a `signed long int' can hold. */
if __WORDSIZE == 64
define LONG_MAX 9223372036854775807L
else
define LONG_MAX 2147483647L
endif
define LONG_MIN (-LONG_MAX - 1L)
/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
if __WORDSIZE == 64
define ULONG_MAX 18446744073709551615UL
else
define ULONG_MAX 4294967295UL
endif
ifdef __USE_ISOC99
/* Minimum and maximum values a `signed long long int' can hold. */
define LLONG_MAX 9223372036854775807LL
define LLONG_MIN (-LLONG_MAX - 1LL)
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
define ULLONG_MAX 18446744073709551615ULL
So unsigned long long int
and unsigned long int
seem to have same max value of 18446744073709551615 ...
Does that mean long long
means same as long
in this machine?
If so, why then do we have a separate long long
specifier?
From reading C books, I expected long long
to be double the size of long
.
Am I going wrong somewhere?
(But yes, I agree with standards that int >= short int
, long >= int
, but it is hard to digest long long >= long
.)