[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Integers not fully functional?
- From: Dirk Zoller <duz@...>
- Date: Tue, 29 Jan 2013 11:44:22 +0100
according to Lua-5.2 doc we have
typedef ptrdiff_t lua_Integer;
On my x86_64-linux-gnu system, this is an 8 byte/64 bit integer.
I need to handle such 64 bit integers that appear as specific IDs.
The numerical value is less interesting than being able to reproduce
the bits identifying an object.
Trying the number
2^63 - 123456789 == 9223372036731319019
Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> print(string.format("%d", i))
The variable i's value is off by 277 from what I stored there...
Given the new data type lua_Integer, I was hoping that I could
store and retrieve pristinely 64 bit quantities in Lua-5.2.
Is there any obvious way to do that which I'm missing?