AND
← _G
code:lua
AND(a,b)
table:
#1 integer
#2 integer
戻り値 integer a & b
a,bのビット積を返す
実装例
code:cpp
int l_AND(lua_State* L) {
unsigned int a = luaL_checkinteger(L,1);
unsigned int b = luaL_checkinteger(L,2);
lua_pushinteger(L, a & b);
return 1;
}
tips
LuaJITやBitOPが使える環境ではbit.bandを使うべきである