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