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

Function LEnum

third-party/lua-5.4.6/src/lvm.c:505–521  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

503** Return 'l <= r', for numbers.
504*/
505l_sinline int LEnum (const TValue *l, const TValue *r) {
506 lua_assert(ttisnumber(l) && ttisnumber(r));
507 if (ttisinteger(l)) {
508 lua_Integer li = ivalue(l);
509 if (ttisinteger(r))
510 return li <= ivalue(r); /* both are integers */
511 else /* 'l' is int and 'r' is float */
512 return LEintfloat(li, fltvalue(r)); /* l <= r ? */
513 }
514 else {
515 lua_Number lf = fltvalue(l); /* 'l' must be float */
516 if (ttisfloat(r))
517 return luai_numle(lf, fltvalue(r)); /* both are float */
518 else /* 'l' is float and 'r' is int */
519 return LEfloatint(lf, ivalue(r));
520 }
521}
522
523
524/*

Callers 1

luaV_lessequalFunction · 0.70

Calls 2

LEintfloatFunction · 0.70
LEfloatintFunction · 0.70

Tested by

no test coverage detected