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:
Josh Koon 2019-02-22 10:00:19 -08:00 committed by GitHub
commit 73372283a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 146 additions and 145 deletions

View file

@ -307,7 +307,7 @@ Rational CalcInput::ToRational(uint32_t radix, int32_t precision)
PRAT rat = StringToRat(m_base.IsNegative(), m_base.value, m_exponent.IsNegative(), m_exponent.value, radix, precision);
if (rat == nullptr)
{
return Rational{};
return 0;
}
Rational result{ rat };