Why are floats converted from different integers sometimes equal?
"float" and "int" in Java both use 32 bits. "float" can represent some numbers that "int" can't, like 0.5. Since 32 bits let you store exactly $2^{32}$ different values, it should be obvious that there must be "int" values that you cannot store in a "float".

"float" in Java, and "float" in many other language implementations, uses one bit for the sign, 8 bits for an exponent, and 23 bits plus one implicit bit for the mantissa. As numbers get bigger, the distance from one "float" to the next gets bigger. The 23 bit mantissa lets you store exactly the integers in the range $2^{23}≤x&lt;2^{24}$, all the even integers in the range $2^{24}≤x&lt;2^{25}$, all multiples of four in the range $2^{25}≤x&lt;2^{26}$ etc.