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

Function LEnum

lib/lua/src/lvm.c:512–528  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

luaV_lessequalFunction · 0.85

Calls 2

LEintfloatFunction · 0.85
LEfloatintFunction · 0.85

Tested by

no test coverage detected