mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/continuous_function_cache] abs -> fabs
Replaced abs calls on float with fabs. Change-Id: I26eda164416ca8b2d601431a59171fd7b00ed33f
This commit is contained in:
committed by
Émilie Feral
parent
15988f0fae
commit
1de6ac702d
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user