From a66e43aff1a147826d7c65d21305d0a62bc50524 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Wed, 15 Aug 2012 22:01:51 -0700 Subject: [PATCH] Location Lib : Abs was overflowing causing bad comparison --- libraries/AP_Math/location.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Math/location.cpp b/libraries/AP_Math/location.cpp index 2d6f57f516..7035ce59da 100644 --- a/libraries/AP_Math/location.cpp +++ b/libraries/AP_Math/location.cpp @@ -31,7 +31,7 @@ static float longitude_scale(const struct Location *loc) { static int32_t last_lat; static float scale = 1.0; - if (abs(last_lat - loc->lat) < 100000) { + if (labs(last_lat - loc->lat) < 100000) { // we are within 0.01 degrees (about 1km) of the // same latitude. We can avoid the cos() and return // the same scale factor.