diff --git a/poincare/include/poincare/zoom.h b/poincare/include/poincare/zoom.h index 591e64b20..dae416203 100644 --- a/poincare/include/poincare/zoom.h +++ b/poincare/include/poincare/zoom.h @@ -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); }; } diff --git a/poincare/src/zoom.cpp b/poincare/src/zoom.cpp index b9683b6f2..20cf54bb1 100644 --- a/poincare/src/zoom.cpp +++ b/poincare/src/zoom.cpp @@ -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); +} + }