Use implicit conversion of 0 to Rational

This commit is contained in:
Josh Koon 2019-02-18 15:12:36 -08:00
commit b1a2cc1d3c
2 changed files with 4 additions and 4 deletions

View file

@ -61,7 +61,7 @@ CalcEngine::Rational CCalcEngine::TruncateNumForIntMath(CalcEngine::Rational con
// Can be converting a dec negative number to Hex/Oct/Bin rep. Use 2's complement form
// Check the range.
if (result.IsLess(Rational{}, m_precision))
if (result.IsLess(0, m_precision))
{
// if negative make positive by doing a twos complement
result = result.Negate();
@ -146,7 +146,7 @@ int CCalcEngine::IsNumberInvalid(const wstring& numberString, int iMaxExp, int i
// in case there's an exponent:
// its optionally followed by a + or -
// which is followed by zero or more digits
wregex rx(wstring{ c_decPreSepStr } +m_decimalSeparator + wstring{ c_decPostSepStr });
wregex rx(wstring{ c_decPreSepStr } + m_decimalSeparator + wstring{ c_decPostSepStr });
wsmatch matches;
if (regex_match(numberString, matches, rx))
{

View file

@ -37,7 +37,7 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
/* Return complement. */
case IDC_COM:
result = rat.Not(true, m_chopNumbers[m_numwidth], m_radix, m_precision);
result = rat.Not(m_fIntegerMode, m_chopNumbers[m_numwidth], m_radix, m_precision);
break;
// Rotate Left with hi bit wrapped over to lo bit
@ -136,7 +136,7 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
result = Pow(rat, 2, m_radix, m_precision);
break;
case IDC_SQRT: /* Sqrt only in Std mode */
case IDC_SQRT: /* Square Root */
result = Root(rat, 2, m_radix, m_precision);
break;