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

Function LTfloatint

lib/lua/src/lvm.c:457–467  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

455** See comments on previous function.
456*/
457l_sinline int LTfloatint (lua_Number f, lua_Integer i) {
458 if (l_intfitsf(i))
459 return luai_numlt(f, cast_num(i)); /* compare them as floats */
460 else { /* f < i <=> floor(f) < i */
461 lua_Integer fi;
462 if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */
463 return fi < i; /* compare them as integers */
464 else /* 'f' is either greater or less than all integers */
465 return f < 0; /* less? */
466 }
467}
468
469
470/*

Callers 1

LTnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected