Floating-point numbers are tricky[1].
One point which often bites people which isn't highlighted in this article, is that due to having an explicit sign bit 0 and -0 have different encodings, but in most cases you'll want them to compare equal. So just comparing the bits won't do.
IIRC even the .Net CLR had this issue way back in the 1.1 days.
For some problems, it can often make sense to switch to arbitrary precision numbers, at least for some parts of the calculations.