** Check whether integer 'i' is less than or equal to float 'f'. ** See comments on previous function. */
| 431 | ** See comments on previous function. |
| 432 | */ |
| 433 | l_sinline int LEintfloat (lua_Integer i, lua_Number f) { |
| 434 | if (l_intfitsf(i)) |
| 435 | return luai_numle(cast_num(i), f); /* compare them as floats */ |
| 436 | else { /* i <= f <=> i <= floor(f) */ |
| 437 | lua_Integer fi; |
| 438 | if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */ |
| 439 | return i <= fi; /* compare them as integers */ |
| 440 | else /* 'f' is either greater or less than all integers */ |
| 441 | return f > 0; /* greater? */ |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | |
| 446 | /* |
no test coverage detected