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

Function LEnum

third-party/lua-5.5.0/src/lvm.c:515–531  ·  view source on GitHub ↗

** Return 'l <= r', for numbers. */

Source from the content-addressed store, hash-verified

513** Return 'l <= r', for numbers.
514*/
515l_sinline int LEnum (const TValue *l, const TValue *r) {
516 lua_assert(ttisnumber(l) && ttisnumber(r));
517 if (ttisinteger(l)) {
518 lua_Integer li = ivalue(l);
519 if (ttisinteger(r))
520 return li <= ivalue(r); /* both are integers */
521 else /* 'l' is int and 'r' is float */
522 return LEintfloat(li, fltvalue(r)); /* l <= r ? */
523 }
524 else {
525 lua_Number lf = fltvalue(l); /* 'l' must be float */
526 if (ttisfloat(r))
527 return luai_numle(lf, fltvalue(r)); /* both are float */
528 else /* 'l' is float and 'r' is int */
529 return LEfloatint(lf, ivalue(r));
530 }
531}
532
533
534/*

Callers 1

luaV_lessequalFunction · 0.70

Calls 2

LEintfloatFunction · 0.70
LEfloatintFunction · 0.70

Tested by

no test coverage detected