Oh, and I wouldn't call the +-2^52 trick a hack.
Does it work for single-precision Lua? :) Very clever though. How's LuaJIT 2.x coming along? - Alex