Yes; casting doubles to floats can give different results.
If the difference between aand is btoo small to be displayed in the float, it compare2()will return 0, then it compare1()will not.
You just edited a question to cancel what you requested. New answer:
I am pretty sure that they will always be the same.
SLaks source
share