mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare/zoom] Method NextUnit
Change-Id: I8200c38fd44b662dcffa8e9850fc272f3e2dc7e8
This commit is contained in:
committed by
EmilieNumworks
parent
cfc37f1bac
commit
e4162976e4
@@ -67,6 +67,7 @@ private:
|
||||
* an asymptote, by recursively computing the slopes. In case of an extremum,
|
||||
* the slope should taper off toward the center. */
|
||||
static bool IsConvexAroundExtremum(ValueAtAbscissa evaluation, float x1, float x2, float x3, float y1, float y2, float y3, Context * context, const void * auxiliary, int iterations = 3);
|
||||
static void NextUnit(float * mantissa, float * exponent);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -371,4 +371,21 @@ bool Zoom::IsConvexAroundExtremum(ValueAtAbscissa evaluation, float x1, float x2
|
||||
return true;
|
||||
}
|
||||
|
||||
void Zoom::NextUnit(float * mantissa, float * exponent) {
|
||||
if (*mantissa == k_smallUnitMantissa) {
|
||||
*mantissa = k_mediumUnitMantissa;
|
||||
return;
|
||||
}
|
||||
if (*mantissa == k_mediumUnitMantissa) {
|
||||
*mantissa = k_largeUnitMantissa;
|
||||
return;
|
||||
}
|
||||
if (*mantissa == k_largeUnitMantissa) {
|
||||
*mantissa = k_smallUnitMantissa;
|
||||
*exponent = 10.f * *exponent;
|
||||
return;
|
||||
}
|
||||
assert(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user