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

Function LEfloatint

lib/lua/src/lvm.c:474–484  ·  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

472** See comments on previous function.
473*/
474l_sinline int LEfloatint (lua_Number f, lua_Integer i) {
475 if (l_intfitsf(i))
476 return luai_numle(f, cast_num(i)); /* compare them as floats */
477 else { /* f <= i <=> ceil(f) <= i */
478 lua_Integer fi;
479 if (luaV_flttointeger(f, &fi, F2Iceil)) /* fi = ceil(f) */
480 return fi <= i; /* compare them as integers */
481 else /* 'f' is either greater or less than all integers */
482 return f < 0; /* less? */
483 }
484}
485
486
487/*

Callers 1

LEnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected