MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / LEnum

Function LEnum

3rd/lua-5.4.3/src/lvm.c:498–514  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

496** Return 'l <= r', for numbers.
497*/
498static int LEnum (const TValue *l, const TValue *r) {
499 lua_assert(ttisnumber(l) && ttisnumber(r));
500 if (ttisinteger(l)) {
501 lua_Integer li = ivalue(l);
502 if (ttisinteger(r))
503 return li <= ivalue(r); /* both are integers */
504 else /* 'l' is int and 'r' is float */
505 return LEintfloat(li, fltvalue(r)); /* l <= r ? */
506 }
507 else {
508 lua_Number lf = fltvalue(l); /* 'l' must be float */
509 if (ttisfloat(r))
510 return luai_numle(lf, fltvalue(r)); /* both are float */
511 else /* 'l' is float and 'r' is int */
512 return LEfloatint(lf, ivalue(r));
513 }
514}
515
516
517/*

Callers 1

luaV_lessequalFunction · 0.85

Calls 2

LEintfloatFunction · 0.85
LEfloatintFunction · 0.85

Tested by

no test coverage detected