** Check whether float 'f' is less than integer 'i'. ** See comments on previous function. */
| 455 | ** See comments on previous function. |
| 456 | */ |
| 457 | l_sinline int LTfloatint (lua_Number f, lua_Integer i) { |
| 458 | if (l_intfitsf(i)) |
| 459 | return luai_numlt(f, cast_num(i)); /* compare them as floats */ |
| 460 | else { /* f < i <=> floor(f) < i */ |
| 461 | lua_Integer fi; |
| 462 | if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */ |
| 463 | return fi < i; /* compare them as integers */ |
| 464 | else /* 'f' is either greater or less than all integers */ |
| 465 | return f < 0; /* less? */ |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | |
| 470 | /* |
no test coverage detected