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

Function LTnum

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

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

Source from the content-addressed store, hash-verified

491** Return 'l < r', for numbers.
492*/
493l_sinline int LTnum (const TValue *l, const TValue *r) {
494 lua_assert(ttisnumber(l) && ttisnumber(r));
495 if (ttisinteger(l)) {
496 lua_Integer li = ivalue(l);
497 if (ttisinteger(r))
498 return li < ivalue(r); /* both are integers */
499 else /* 'l' is int and 'r' is float */
500 return LTintfloat(li, fltvalue(r)); /* l < r ? */
501 }
502 else {
503 lua_Number lf = fltvalue(l); /* 'l' must be float */
504 if (ttisfloat(r))
505 return luai_numlt(lf, fltvalue(r)); /* both are float */
506 else /* 'l' is float and 'r' is int */
507 return LTfloatint(lf, ivalue(r));
508 }
509}
510
511
512/*

Callers 1

luaV_lessthanFunction · 0.70

Calls 2

LTintfloatFunction · 0.70
LTfloatintFunction · 0.70

Tested by

no test coverage detected