lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 04.12.2013 21:27 schröbte Alexander Nasonov:
Philipp Janda wrote:
Makes sense. "long long" has a much higher chance of being 64 bits on 32
bit machines, and having 64 bit integers becomes important in Lua 5.3.

The text below is from pre-C11 standard but I'm pretty sure it's no
different from C99 (too lazy to unpack a box with my hardcopy of C99,
I recently moved house).

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1539.pdf

5.2.4.2.1 Sizes of integer types <limits.h>

-- minimum value for an object of type long long int
LLONG_MIN -9223372036854775807 // - (2^63 - 1)

-- maximum value for an object of type long long int
LLONG_MAX +9223372036854775807 // 2^63 - 1

-- maximum value for an object of type unsigned long long int
ULLONG_MAX 18446744073709551615 // 2^64 - 1


Thanks for confirming. It's the same for C99 btw., so the probability of "long long" being at least 64 bit is 100% on C99-compilers (and up), and still pretty good when we add C90 compilers to the mix.

Philipp