mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-19 12:59:30 -07:00
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:
parent
47f9996fa9
commit
73372283a0
14 changed files with 146 additions and 145 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue