By default, Java compiler perceives 2.1 as being a double (64 bits) and not as a float (32 bits). Declaring float f=2.1 would result in loss of precision. Hence, Java forces you to do the casting to make sure you are declaring a float variable.
Without casting, you can achieve the same with the letter 'f' at the end of floating point numbers. For example, float f=2.1f.
Now you might ask, why a cast isn't required while converting from a long to a float because the former uses more bits internally than the latter. The answer is Java needs no casting on a widening path - byte => short => int => long => float => double.
(Left to right (a widening conversion) - cast is not required;
Right to left (a narrowing conversion) - explicit cast is required)