MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / LTfloatint

Function LTfloatint

3rd/lua-5.4.3/src/lvm.c:443–453  ·  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

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

Callers 1

LTnumFunction · 0.85

Calls 1

luaV_flttointegerFunction · 0.85

Tested by

no test coverage detected