http://bitop.luajit.org/index.html
Lua BitOp is a C extension module for Lua 5.1/5.2which adds bitwise operations on numbers.
Lua BitOp is Copyright © 2008-2012 Mike Pall.Lua BitOp is free software, released under theMIT license(same license as the Lua core).
Features
- Supported functions:bit.tobit, bit.tohex, bit.bnot, bit.band, bit.bor, bit.bxor,bit.lshift, bit.rshift, bit.arshift, bit.rol, bit.ror, bit.bswap
- Consistent semanticsacross 16, 32 and 64 bit platforms.
- Supports different lua_Number types:either IEEE 754 doubles, int32_t or int64_t.
- Runs on Linux, *BSD, Mac OS X, Windows and probably anything elseyou can find.
- Simple installation on all systems.No bulky configure scripts. Embedded-systems-friendly.
- Internal self-test on startup to detect miscompiles.Includes a comprehensive test and benchmark suite.
- Compatible with the built-in bitwise operations inLuaJIT 2.0.
- It's as fast as you can get with the standard Lua/C API.
More ...
Please click on one of the links in the navigation bar to your leftto learn more.
Please visit the Download page to fetchthe current version of Lua BitOp.
News
-
2012-05-08
Lua BitOp 1.0.2 has been released
-
This release adds compatibility with both Lua 5.1 and Lua 5.2.
Embedding Lua BitOp
If you're embedding Lua into your application, it's quite simple toadd Lua BitOp as a static module:
1. Copy the file bit.c from the Lua BitOp distributionto your Lua source code directory.
2. Add this file to your build script (e.g. modify the Makefile) orimport it as a build dependency in your IDE.
3. Edit lualib.h and add the following two lines:
#define LUA_BITLIBNAME "bit" LUALIB_API int luaopen_bit(lua_State *L);
4. Edit linit.c and add this immediately before the linewith {NULL, NULL}:
{LUA_BITLIBNAME, luaopen_bit},
5. Now recompile and you're done!
LuaBitOp是一个为Lua5.1/5.2设计的C扩展模块,提供了针对数字的位运算操作。它支持多种位运算函数,如按位与、按位或等,并且在16位、32位和64位平台上具有一致的语义。该模块适用于不同的lua_Number类型,并在多种操作系统上运行。
3182

被折叠的 条评论
为什么被折叠?



