I want to convert a number (64 bit double precision) into two integer numbers (unsigned 32 bits) and back. Is that possible to do without precision loss? The 64 bit number should fit into two 32 bit numbers, I just can't figure out how to do it in Lua.
My experiments with the bitop library in LuaJIT did not result in anything useful. Is it possible to cast the number to unsigned long long
and split that one up, in pure Lua code using the ffi API?
Maybe it's not possible without precision loss. What is a reasonable way to do it, even if I lose precision?