|
From: Nicholas N. <nj...@cs...> - 2008-05-07 07:14:50
|
On Tue, 6 May 2008, Dirk Stoecker wrote: > Usually it is better to have an "if(fabs(a-b) < epsilon)" compared to an > "if(a == b)". That is better than pure equality, but still has various pitfalls. See http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm for an excellent discussion of this topic, and a very nice implementation of FP equality. Nick |