On 06/21/2011 05:03 PM, Bradley Lowekamp wrote: > I like the following methods for tolerant comparison: > > abs( f1-f2 ) > numeric_limits<double|float>::epsilon()*(1u<<BITS )*max( f1, 1.0) http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm -Brad K