Lua C api:处理大量数据
我在代码中处理皮秒(数字> 10 ^ 12).
将数据传递给Lua的C代码(atime和eventid都是size_t类型) lua_getglobal ( luactx,"timer_callback" ); lua_pushunsigned ( luactx,atime ); lua_pushunsigned ( luactx,eventid ); lua_pcall ( luactx,2,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位.从
reference manual:
通过编辑luaconf.h,可以相当容易地强制使用Lua 5.2 lua使用不同的数字类型.数字类型定义为LUA_NUMBER. 对于lua 5.1,您可以安装lnum补丁,这将更改整数类型. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- java – JUnit测试对@transactional @Async方法的调用导致
- 学习elua(一)——简介
- xBIM 05 3D墙案例
- delphi – IfThen(Assigned(Widget),Widget.Description,’
- delphi xe5 android 开发实现手机打电话和发短信
- How to deploy a Delphi OSX project from the command lin
- delphi服务程序(service)的调试方法
- Delphi获取进程快照(snapshot)
- delphi – 应该“库路径”指向包的源文件吗?
- 105. Construct Binary Tree from Preorder and Inorder Tr