15 m_firstSimplestNumber (0)
23 double absMin = qAbs (xMin);
24 double absMax = qAbs (xMax);
25 int D = qFloor (log10 (qMax (absMin, absMax)) +
EPSILON);
31 double roundedMin = 0.0;
34 roundedMin = roundToDigit (xMin, R);
35 double nominalStep = qPow (10.0, R);
37 if (xMin < 0 && xMin < roundedMin) {
40 roundedMin -= nominalStep;
44 if (roundedMin + 2 * nominalStep <= xMax) {
51 m_firstSimplestNumber = roundedMin;
56 return m_firstSimplestNumber;
59 double ExportAlignLinear::log10 (
double in)
const
61 return qLn (in) / qLn (10.0);
64 double ExportAlignLinear::roundToDigit (
double value,
67 double scale = qPow (10.0, digit);
68 int valueRoundedWithWrongScale = qFloor (value / scale +
EPSILON);
69 double valueRounded = valueRoundedWithWrongScale * scale;
ExportAlignLinear(double xMin, double xMax)
Single constructor.
double firstSimplestNumber() const
Result.
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...