MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / LEnum

Function LEnum

extlibs/lua/src/lvm.c:501–517  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

luaV_lessequalFunction · 0.85

Calls 2

LEintfloatFunction · 0.85
LEfloatintFunction · 0.85

Tested by

no test coverage detected