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

Function LEintfloat

lib/lua/src/lvm.c:440–450  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

438** See comments on previous function.
439*/
440l_sinline int LEintfloat (lua_Integer i, lua_Number f) {
441 if (l_intfitsf(i))
442 return luai_numle(cast_num(i), f); /* compare them as floats */
443 else { /* i <= f <=> i <= floor(f) */
444 lua_Integer fi;
445 if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */
446 return i <= fi; /* compare them as integers */
447 else /* 'f' is either greater or less than all integers */
448 return f > 0; /* greater? */
449 }
450}
451
452
453/*

Callers 1

LEnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected