Home | History | Annotate | Download | only in forms

Lines Matching full:decimal

53 StepRange::StepRange(const Decimal& stepBase, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription& stepDescription)
67 Decimal StepRange::acceptableError() const
70 DEFINE_STATIC_LOCAL(const Decimal, twoPowerOfFloatMantissaBits, (Decimal::Positive, 0, UINT64_C(1) << FLT_MANT_DIG));
71 return m_stepDescription.stepValueShouldBe == StepValueShouldBeReal ? m_step / twoPowerOfFloatMantissaBits : Decimal(0);
74 Decimal StepRange::alignValueForStep(const Decimal& currentValue, const Decimal& newValue) const
76 DEFINE_STATIC_LOCAL(const Decimal, tenPowerOf21, (Decimal::Positive, 21, 1));
83 Decimal StepRange::clampValue(const Decimal& value) const
85 const Decimal inRangeValue = std::max(m_minimum, std::min(value, m_maximum));
89 const Decimal roundedValue = roundByStep(inRangeValue, m_stepBase);
90 const Decimal clampedValue = roundedValue > m_maximum ? roundedValue - m_step : (roundedValue < m_minimum ? roundedValue + m_step : roundedValue);
96 Decimal StepRange::parseStep(AnyStepHandling anyStepHandling, const StepDescription& stepDescription, const String& stepString)
104 return Decimal::nan();
112 Decimal step = parseToDecimalForNumberType(stepString);
122 step = std::max(step.round(), Decimal(1));
128 step = std::max(step.round(), Decimal(1));
138 Decimal StepRange::roundByStep(const Decimal& value, const Decimal& base) const
143 bool StepRange::stepMismatch(const Decimal& valueForCheck) const
149 const Decimal value = (valueForCheck - m_stepBase).abs();
152 // Decimal's fractional part size is DBL_MAN_DIG-bit. If the current value
155 DEFINE_STATIC_LOCAL(const Decimal, twoPowerOfDoubleMantissaBits, (Decimal::Positive, 0, UINT64_C(1) << DBL_MANT_DIG));
161 const Decimal remainder = (value - m_step * (value / m_step).round()).abs();
164 const Decimal computedAcceptableError = acceptableError();