MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaK_numberK

Function luaK_numberK

freebsd/contrib/openzfs/module/lua/lcode.c:324–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322
323
324int luaK_numberK (FuncState *fs, lua_Number r) {
325 int n;
326 lua_State *L = fs->ls->L;
327 TValue o;
328 setnvalue(&o, r);
329 if (r == 0 || luai_numisnan(NULL, r)) { /* handle -0 and NaN */
330 /* use raw representation as key to avoid numeric problems */
331 setsvalue(L, L->top++, luaS_newlstr(L, (char *)&r, sizeof(r)));
332 n = addk(fs, L->top - 1, &o);
333 L->top--;
334 }
335 else
336 n = addk(fs, &o, &o); /* regular case */
337 return n;
338}
339
340
341static int boolK (FuncState *fs, int b) {

Callers 3

fornumFunction · 0.70
discharge2regFunction · 0.70
luaK_exp2RKFunction · 0.70

Calls 2

luaS_newlstrFunction · 0.70
addkFunction · 0.70

Tested by

no test coverage detected