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

Function LTfloatint

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

444** See comments on previous function.
445*/
446static int LTfloatint (lua_Number f, lua_Integer i) {
447 if (l_intfitsf(i))
448 return luai_numlt(f, cast_num(i)); /* compare them as floats */
449 else { /* f < i <=> floor(f) < i */
450 lua_Integer fi;
451 if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */
452 return fi < i; /* compare them as integers */
453 else /* 'f' is either greater or less than all integers */
454 return f < 0; /* less? */
455 }
456}
457
458
459/*

Callers 1

LTnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected