[Insight-developers] Methods for comparing meta-data with tolerance

Brad King brad.king at kitware.com
Tue Jun 21 17:24:47 EDT 2011


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


More information about the Insight-developers mailing list