** Check whether integer 'i' is less than or equal to float 'f'. ** See comments on previous function. */
| 438 | ** See comments on previous function. |
| 439 | */ |
| 440 | l_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 | /* |
no test coverage detected