5
我在我的代碼中處理皮秒(數字大於10^12)。
C代碼將數據傳遞到Lua(atime的和事件ID都爲size_t類型的)Lua C api:處理大量數字
lua_getglobal (luactx, "timer_callback");
lua_pushunsigned (luactx, atime);
lua_pushunsigned (luactx, eventid);
lua_pcall (luactx, 2, 0, 0);
的Lua功能
function timer_callback(time, eventid)
if eventid == TX_CLOCK then
out_log(tostring(time)) --result is random garbage
set_callback(time + 1000000000000, TX_CLOCK)
return
end
end
我試圖調用lua_pushnumber但結果在LUA我得到負數。
lua的哪個版本? 5.3支持'lua_Integer',默認是64位。 – indiv 2014-09-23 16:44:01
我使用5.2下的Win32 – pugnator 2014-09-23 16:45:05
個人,請將您的消息作爲答案。我只是從源代碼構建5.3,重新編譯我的應用程序,所有工作都像一個魅力 – pugnator 2014-09-23 17:01:21