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