CalcEngine: Remove the need to specify base/radix when working with Rational values (#31)
- Separates values from the representation (base/radix) of those values. - Uses a single base for all values represented as Rationals. - Rationals are converted to/from a specific base when they are converted to/from strings.
This commit is contained in:
@@ -95,7 +95,7 @@ CCalcEngine::CCalcEngine(bool fPrecedence, bool fIntegerMode, CalculationManager
|
||||
|
||||
m_dwWordBitWidth = DwWordBitWidthFromeNumWidth(m_numwidth);
|
||||
|
||||
m_maxTrigonometricNum = RationalMath::Pow(10, 100, m_radix, m_precision);
|
||||
m_maxTrigonometricNum = RationalMath::Pow(10, 100, m_precision);
|
||||
|
||||
SetRadixTypeAndNumWidth(DEC_RADIX, m_numwidth);
|
||||
SettingsChanged();
|
||||
@@ -118,7 +118,7 @@ void CCalcEngine::InitChopNumbers()
|
||||
for (size_t i = 0; i < m_chopNumbers.size(); i++)
|
||||
{
|
||||
auto maxVal = m_chopNumbers[i].Div(2, m_precision);
|
||||
maxVal = RationalMath::Integer(maxVal, m_radix, m_precision);
|
||||
maxVal = RationalMath::Integer(maxVal, m_precision);
|
||||
|
||||
m_maxDecimalValueStrings[i] = maxVal.ToString(10, FMT_FLOAT, m_precision);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user