MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / lua_arith

Function lua_arith

ThirdParty/lua/lua/lapi.c:301–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299
300
301LUA_API void lua_arith (lua_State *L, int op) {
302 lua_lock(L);
303 if (op != LUA_OPUNM && op != LUA_OPBNOT)
304 api_checknelems(L, 2); /* all other operations expect two operands */
305 else { /* for unary operations, add fake 2nd operand */
306 api_checknelems(L, 1);
307 setobjs2s(L, L->top, L->top - 1);
308 L->top++;
309 }
310 /* first operand at top - 2, second at top - 1; result go to top - 2 */
311 luaO_arith(L, op, L->top - 2, L->top - 1, L->top - 2);
312 L->top--; /* remove second operand */
313 lua_unlock(L);
314}
315
316
317LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {

Callers

nothing calls this directly

Calls 1

luaO_arithFunction · 0.85

Tested by

no test coverage detected