** Check whether float 'f' is less than integer 'i'. ** See comments on previous function. */
| 444 | ** See comments on previous function. |
| 445 | */ |
| 446 | static int LTfloatint (lua_Number f, lua_Integer i) { |
| 447 | if (l_intfitsf(i)) |
| 448 | return luai_numlt(f, cast_num(i)); /* compare them as floats */ |
| 449 | else { /* f < i <=> floor(f) < i */ |
| 450 | lua_Integer fi; |
| 451 | if (luaV_flttointeger(f, &fi, F2Ifloor)) /* fi = floor(f) */ |
| 452 | return fi < i; /* compare them as integers */ |
| 453 | else /* 'f' is either greater or less than all integers */ |
| 454 | return f < 0; /* less? */ |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | |
| 459 | /* |
no test coverage detected