Add compare_float function to compare floats.