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 // Can be converting a dec negative number to Hex/Oct/Bin rep. Use 2's complement form
// Check the range. // Check the range.
if (result.IsLess(Rational{}, m_precision)) if (result.IsLess(0, m_precision))
{ {
// if negative make positive by doing a twos complement // if negative make positive by doing a twos complement
result = result.Negate(); result = result.Negate();

View file

@ -37,7 +37,7 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
/* Return complement. */ /* Return complement. */
case IDC_COM: 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; break;
// Rotate Left with hi bit wrapped over to lo bit // 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); result = Pow(rat, 2, m_radix, m_precision);
break; break;
case IDC_SQRT: /* Sqrt only in Std mode */ case IDC_SQRT: /* Square Root */
result = Root(rat, 2, m_radix, m_precision); result = Root(rat, 2, m_radix, m_precision);
break; break;