safe float comparison in tests