MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / lua_arith

Function lua_arith

src/Chain/libraries/glua/lapi.cpp:305–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303
304
305LUA_API void lua_arith(lua_State *L, int op) {
306 lua_lock(L);
307 if (op != LUA_OPUNM && op != LUA_OPBNOT)
308 api_checknelems(L, 2); /* all other operations expect two operands */
309 else { /* for unary operations, add fake 2nd operand */
310 api_checknelems(L, 1);
311 setobjs2s(L, L->top, L->top - 1);
312 api_incr_top(L);
313 }
314 /* first operand at top - 2, second at top - 1; result go to top - 2 */
315 luaO_arith(L, op, L->top - 2, L->top - 1, L->top - 2);
316 L->top--; /* remove second operand */
317 lua_unlock(L);
318}
319
320
321LUA_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