MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / intarith

Function intarith

third-party/lua-5.5.0/src/lobject.c:115–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114
115static lua_Integer intarith (lua_State *L, int op, lua_Integer v1,
116 lua_Integer v2) {
117 switch (op) {
118 case LUA_OPADD: return intop(+, v1, v2);
119 case LUA_OPSUB:return intop(-, v1, v2);
120 case LUA_OPMUL:return intop(*, v1, v2);
121 case LUA_OPMOD: return luaV_mod(L, v1, v2);
122 case LUA_OPIDIV: return luaV_idiv(L, v1, v2);
123 case LUA_OPBAND: return intop(&, v1, v2);
124 case LUA_OPBOR: return intop(|, v1, v2);
125 case LUA_OPBXOR: return intop(^, v1, v2);
126 case LUA_OPSHL: return luaV_shiftl(v1, v2);
127 case LUA_OPSHR: return luaV_shiftr(v1, v2);
128 case LUA_OPUNM: return intop(-, 0, v1);
129 case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1);
130 default: lua_assert(0); return 0;
131 }
132}
133
134
135static lua_Number numarith (lua_State *L, int op, lua_Number v1,

Callers 1

luaO_rawarithFunction · 0.70

Calls 3

luaV_modFunction · 0.70
luaV_idivFunction · 0.70
luaV_shiftlFunction · 0.70

Tested by

no test coverage detected