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

Function LTnum

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

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

Source from the content-addressed store, hash-verified

481** Return 'l < r', for numbers.
482*/
483l_sinline int LTnum (const TValue *l, const TValue *r) {
484 lua_assert(ttisnumber(l) && ttisnumber(r));
485 if (ttisinteger(l)) {
486 lua_Integer li = ivalue(l);
487 if (ttisinteger(r))
488 return li < ivalue(r); /* both are integers */
489 else /* 'l' is int and 'r' is float */
490 return LTintfloat(li, fltvalue(r)); /* l < r ? */
491 }
492 else {
493 lua_Number lf = fltvalue(l); /* 'l' must be float */
494 if (ttisfloat(r))
495 return luai_numlt(lf, fltvalue(r)); /* both are float */
496 else /* 'l' is float and 'r' is int */
497 return LTfloatint(lf, ivalue(r));
498 }
499}
500
501
502/*

Callers 1

luaV_lessthanFunction · 0.70

Calls 2

LTintfloatFunction · 0.70
LTfloatintFunction · 0.70

Tested by

no test coverage detected