167 virtual double GetRounded(
const double& value)
const override;
168 virtual bool AreValuesEqual(
const double& value1,
const double& value2)
const override;
169 virtual bool IsSmaller(
const double& value1,
const double& value2)
const override;
170 virtual bool IsSmallerEqual(
const double& value1,
const double& value2)
const override;
172 virtual double GetBiggerValue(
const double& value)
const override;
173 virtual QString
GetString(
const double& value)
const override;
174 virtual bool GetParsed(
const QString& text,
double& result)
const override;
182 QString
GetString(
const double& value,
int precision)
const;
190 double m_scaleToIntFactor;
198 return m_roundingType;
246 return qint32(function(value * m_scaleToIntFactor));
252 return intValue / m_scaleToIntFactor;
Simple implementation of double value manipulator without rounding or quantization.
Implementation of double value manipulator with fixed-point arithmetic and rounding.
virtual bool GetParsed(const QString &text, double &result) const override
Get value converted from string.
virtual double GetNormalValue(qint32 intValue) const
virtual qint32 GetInternalValue(double value) const
QString GetString(const double &value, int precision) const
virtual double GetSmallerValue(const double &value) const override
Return biggest value smaller that specified one.
void SetRoundingType(RoundingType roundingType)
Set type of rounding.
@ RT_NORMAL
Normal mathematical rounding to the nearest value.
int(* RoundingFuntionPtr)(qreal value)
virtual double GetBiggerValue(const double &value) const override
Return smallest value bigger that specified one.
virtual int GetPrecision() const override
Get number of digits after point.
virtual bool IsSmallerEqual(const double &value1, const double &value2) const override
Compare two values and check, if first one is smaller or equal as the second.
virtual bool AreValuesEqual(const double &value1, const double &value2) const override
Compare two values and check, if there are equal.
virtual QString GetString(const double &value) const override
Get this value as string.
void SetPrecision(int precision)
Set fixed point precision.
CFixedPointManip(int precision=1, RoundingType roundingType=RT_NORMAL)
virtual double GetRounded(const double &value) const override
Get the nearest value rounded used this arithmetik.
virtual bool IsSmaller(const double &value1, const double &value2) const override
Compare two values and check, if first one is smaller as the second.
RoundingType GetRoundingType() const
Get type of rounding.
Package with mathematical functions and algebraical primitives.