MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / LTnum

Function LTnum

lib/lua/src/lvm.c:490–506  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

luaV_lessthanFunction · 0.85

Calls 2

LTintfloatFunction · 0.85
LTfloatintFunction · 0.85

Tested by

no test coverage detected