cmVectOpsRICode.h : Fixed bug in IsClose().

This commit is contained in:
kevin 2014-02-21 22:46:37 -08:00
parent 08e4aa7c51
commit 8897b62c5b

View File

@ -878,8 +878,16 @@ bool VECT_OP_FUNC(IsClose)( const VECT_OP_TYPE* s0p, const VECT_OP_TYPE* s1p, un
const VECT_OP_TYPE* ep = s0p + sn; const VECT_OP_TYPE* ep = s0p + sn;
for(; s0p < ep; ++s0p,++s1p ) for(; s0p < ep; ++s0p,++s1p )
{ {
double d = abs(*s1p - *s0p); double d = *s1p - *s0p;
double s = cmMin(*s1p,*s0p); double s = cmMin(*s1p,*s0p);
// take abs value of d and s
if( d < 0 )
d *= -1;
if( s < 0 )
s *= -1;
if( d*100.0/s > pct ) if( d*100.0/s > pct )
return false; return false;
} }