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

Function LEintfloat

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

427** See comments on previous function.
428*/
429static int LEintfloat (lua_Integer i, lua_Number f) {
430 if (l_intfitsf(i))
431 return luai_numle(cast_num(i), f); /* compare them as floats */
432 else { /* i <= f <=> i <= floor(f) */
433 lua_Integer fi;
434 if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */
435 return i <= fi; /* compare them as integers */
436 else /* 'f' is either greater or less than all integers */
437 return f > 0; /* greater? */
438 }
439}
440
441
442/*

Callers 1

LEnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected