diff --git a/libraries/AP_Math/AP_Math.cpp b/libraries/AP_Math/AP_Math.cpp index 2db5a00fbeb..abe8a72d82a 100644 --- a/libraries/AP_Math/AP_Math.cpp +++ b/libraries/AP_Math/AP_Math.cpp @@ -23,11 +23,13 @@ template typename std::enable_if::type>::value, bool>::type is_equal(const Arithmetic1 v_1, const Arithmetic2 v_2) { +#ifdef ALLOW_DOUBLE_MATH_FUNCTIONS typedef typename std::common_type::type common_type; typedef typename std::remove_cv::type common_type_nonconst; if (std::is_same::value) { return fabs(v_1 - v_2) < std::numeric_limits::epsilon(); } +#endif return fabsf(v_1 - v_2) < std::numeric_limits::epsilon(); }