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

Function LEfloatint

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

** Check whether float 'f' is less than or equal to integer 'i'. ** See comments on previous function. */

Source from the content-addressed store, hash-verified

458** See comments on previous function.
459*/
460static int LEfloatint (lua_Number f, lua_Integer i) {
461 if (l_intfitsf(i))
462 return luai_numle(f, cast_num(i)); /* compare them as floats */
463 else { /* f <= i <=> ceil(f) <= i */
464 lua_Integer fi;
465 if (luaV_flttointeger(f, &fi, F2Iceil)) /* fi = ceil(f) */
466 return fi <= i; /* compare them as integers */
467 else /* 'f' is either greater or less than all integers */
468 return f < 0; /* less? */
469 }
470}
471
472
473/*

Callers 1

LEnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected