Java treats long to float as a widening conversion; hence no error. Another important point is that Java uses IEEE 754 floating point representation for the float primitive data types. Breakup is 23 for fraction, 8 for exponent and 1 bit for the sign. Therefore, if a particular int can be represented exactly in 23 bits, there will be no loss of precision.
A better explanation is at
http://www.psc.edu/general/software/packages/ieee/ieee.html Sandeep