If you use LuaJIT instead of Lua, you get access to all the built-in types of C99, including long long , which is usually 64 bits.
local ffi = require 'ffi' -- Needed to parse constants that do not fit in a double: ffi.cdef 'long long strtoll(const char *restrict str, char **restrict endptr, int base);' local a = ffi.C.strtoll("99999999999999999", nil, 10) print(a) print(a * a)
=> 3803012203950112769LL (provided that the result is truncated to 64 bits)
finnw source share