mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare/zoom] Use std::min & max
Change-Id: If3983c16d3bfa0de31aefe8a3f5c650e1858f822
This commit is contained in:
committed by
Émilie Feral
parent
3a87e47de5
commit
29f47124b1
@@ -265,11 +265,9 @@ void Zoom::FullRange(ValueAtAbscissa evaluation, float tMin, float tMax, float t
|
||||
*fMax = -FLT_MAX;
|
||||
while (t <= tMax) {
|
||||
float value = evaluation(t, context, auxiliary);
|
||||
if (value < *fMin) {
|
||||
*fMin = value;
|
||||
}
|
||||
if (value > *fMax) {
|
||||
*fMax = value;
|
||||
if (std::isfinite(value)) {
|
||||
*fMin = std::min(*fMin, value);
|
||||
*fMax = std::max(*fMax, value);
|
||||
}
|
||||
t += tStep;
|
||||
}
|
||||
@@ -287,11 +285,11 @@ void Zoom::CombineRanges(int length, const float * mins, const float * maxs, flo
|
||||
FullRange(evaluation, 0, length - 1, 1, minRes, maxRes, nullptr, mins);
|
||||
float min, max;
|
||||
FullRange(evaluation, 0, length - 1, 1, &min, &max, nullptr, maxs);
|
||||
if (min < *minRes) {
|
||||
*minRes = min;
|
||||
if (std::isfinite(min)) {
|
||||
*minRes = std::min(min, *minRes);
|
||||
}
|
||||
if (max > *maxRes) {
|
||||
*maxRes = max;
|
||||
if (std::isfinite(max)) {
|
||||
*maxRes = std::max(max, *maxRes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user