EDIT: Contrary to my initial view, and of some others, the issue isn't do with comparing different types. As per the comments, the most recent C standard that seems to be out there and free (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf) makes it clear that comparison will force type conversion, generally towards the higher precision type.
AS an aside, in my personal view, it is still wiser to make these conversions explicit because then it is clear as you scan the code what is going on. The issue here is probably the one highlighted by another answerer.
It is quite possible the issue is with your typing. It is best to be explicit:
int L=25;
float x;
// Value to x is allotted by long calculation
if (x <= ((float)L)) {
x = x - ((float)L);
}