testing for "close" as opposed to "exact" will sometimes fix such problems.

For example, if you take the difference between two floating point numbers that you believe should be the same, it is NOT a good idea to test the result for 0.0 but rather to test that the absolute value of the difference is less than some really small number.