From 4aeeb2aeca15d2a6c8b529074e2b8bf2ac9ed3b5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 24 Jun 2011 11:44:20 +0200 Subject: Clarify fabs() --- src/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/utils.h b/src/utils.h index a11cd59e..3e0b3af9 100644 --- a/src/utils.h +++ b/src/utils.h @@ -142,8 +142,8 @@ static inline double angle_between(double x1, double y1, double z1, static inline int within_tolerance(double a, double b, double percent) { - double tol = a * (percent/100.0); - if ( fabs(b-a) < fabs(tol) ) return 1; + double tol = fabs(a) * (percent/100.0); + if ( fabs(b-a) < tol ) return 1; return 0; } -- cgit v1.2.3