> That test does not work reliably:
You're right, but floating point numbers don't work reliably (as one
can see in your examples, one has always conversion and rounding
errors)

Nonetheless if one has to work with floating point numbers it is surly
better to define equality in terms of some delta error tolerance.