From 1de6ac702dd7b637e806aeecd2dca7ab0cd5abaa Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Fri, 3 Jul 2020 16:45:26 +0200 Subject: [PATCH] [apps/continuous_function_cache] abs -> fabs Replaced abs calls on float with fabs. Change-Id: I26eda164416ca8b2d601431a59171fd7b00ed33f --- apps/shared/continuous_function_cache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/shared/continuous_function_cache.cpp b/apps/shared/continuous_function_cache.cpp index a2fac0c01..8e165b14b 100644 --- a/apps/shared/continuous_function_cache.cpp +++ b/apps/shared/continuous_function_cache.cpp @@ -73,7 +73,7 @@ int ContinuousFunctionCache::indexForParameter(const ContinuousFunction * functi assert(res >= 0); if ((res >= k_sizeOfCache && function->plotType() == ContinuousFunction::PlotType::Cartesian) || (res >= k_sizeOfCache / 2 && function->plotType() != ContinuousFunction::PlotType::Cartesian) - || std::abs(res - delta) > k_cacheHitTolerance) { + || std::fabs(res - delta) > k_cacheHitTolerance) { return -1; } assert(function->plotType() == ContinuousFunction::PlotType::Cartesian || m_startOfCache == 0); @@ -103,12 +103,12 @@ void ContinuousFunctionCache::pan(ContinuousFunction * function, float newTMin) float dT = (newTMin - m_tMin) / m_tStep; m_tMin = newTMin; - if (std::abs(dT) > INT_MAX) { + if (std::fabs(dT) > INT_MAX) { clear(); return; } int dI = std::round(dT); - if (dI >= k_sizeOfCache || dI <= -k_sizeOfCache || std::abs(dT - dI) > k_cacheHitTolerance) { + if (dI >= k_sizeOfCache || dI <= -k_sizeOfCache || std::fabs(dT - dI) > k_cacheHitTolerance) { clear(); return; }