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

Function LEfloatint

extlibs/lua/src/lvm.c:463–473  ·  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

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

Callers 1

LEnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected