fixed comparison of double values