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.