** Check whether float 'f' is less than or equal to integer 'i'. ** See comments on previous function. */
| 475 | ** See comments on previous function. |
| 476 | */ |
| 477 | l_sinline int LEfloatint (lua_Number f, lua_Integer i) { |
| 478 | if (l_intfitsf(i)) |
| 479 | return luai_numle(f, cast_num(i)); /* compare them as floats */ |
| 480 | else { /* f <= i <=> ceil(f) <= i */ |
| 481 | lua_Integer fi; |
| 482 | if (luaV_flttointeger(f, &fi, F2Iceil)) /* fi = ceil(f) */ |
| 483 | return fi <= i; /* compare them as integers */ |
| 484 | else /* 'f' is either greater or less than all integers */ |
| 485 | return f < 0; /* less? */ |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | |
| 490 | /* |
no test coverage detected