** Check whether float 'f' is less than or equal to integer 'i'. ** See comments on previous function. */
| 461 | ** See comments on previous function. |
| 462 | */ |
| 463 | static int LEfloatint (lua_Number f, lua_Integer i) { |
| 464 | if (l_intfitsf(i)) |
| 465 | return luai_numle(f, cast_num(i)); /* compare them as floats */ |
| 466 | else { /* f <= i <=> ceil(f) <= i */ |
| 467 | lua_Integer fi; |
| 468 | if (luaV_flttointeger(f, &fi, F2Iceil)) /* fi = ceil(f) */ |
| 469 | return fi <= i; /* compare them as integers */ |
| 470 | else /* 'f' is either greater or less than all integers */ |
| 471 | return f < 0; /* less? */ |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | |
| 476 | /* |
no test coverage detected