After a bit of reading, my understanding of the reason for this is as follows:
• C treats numbers like 1,2 as doubles and if they are modified with f eg 1.2f as floating • Neither doubles nor floats can be internally represented by the system with 100% accuracy • Representation errors for floats are higher than for doubling
Therefore, comparing a float with a double will basically lead to misleading results. For non-critical systems, a comparison of 2 floats is sufficient.
source share