lua-users home
lua-l archive

Re: lua_Integer in Lua 5.3

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


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>
1 The values given below shall be replaced by constant expressions suitable
 for use in #if preprocessing directives. Moreover, except for CHAR_BIT
 and MB_LEN_MAX , the following shall be replaced by expressions that
 have the same type as would an expression that is an object of the
 corresponding type converted according to the integer promotions. Their
 implementation-defined values shall be equal or greater in magnitude
 (absolute value) to those shown, with the same sign.
...
-- 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

AltStyle によって変換されたページ (->オリジナル) /