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