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