MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / numarith

Function numarith

src/vm/luavm/lua/lobject.c:105–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105static lua_Number numarith (lua_State *L, int op, lua_Number v1,
106 lua_Number v2) {
107 switch (op) {
108 case LUA_OPADD: return luai_numadd(L, v1, v2);
109 case LUA_OPSUB: return luai_numsub(L, v1, v2);
110 case LUA_OPMUL: return luai_nummul(L, v1, v2);
111 case LUA_OPDIV: return luai_numdiv(L, v1, v2);
112 case LUA_OPPOW: return luai_numpow(L, v1, v2);
113 case LUA_OPIDIV: return luai_numidiv(L, v1, v2);
114 case LUA_OPUNM: return luai_numunm(L, v1);
115 case LUA_OPMOD: {
116 lua_Number m;
117 luai_nummod(L, v1, v2, m);
118 return m;
119 }
120 default: lua_assert(0); return 0;
121 }
122}
123
124
125void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2,

Callers 1

luaO_arithFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected