mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 10:36:50 -07:00
Update intrat function
added a programmer mode test case
This commit is contained in:
parent
41fc032bee
commit
224ccdf885
2 changed files with 11 additions and 0 deletions
|
@ -303,6 +303,12 @@ void intrat(_Inout_ PRAT* px, uint32_t radix, int32_t precision)
|
|||
DUPRAT(pret, *px);
|
||||
remrat(&pret, rat_one);
|
||||
|
||||
// Flatten pret in case it's not aligned with px after remrat operation
|
||||
if (!equnum((*px)->pq, pret->pq))
|
||||
{
|
||||
flatrat(pret, radix, precision);
|
||||
}
|
||||
|
||||
subrat(px, pret, precision);
|
||||
destroyrat(pret);
|
||||
|
||||
|
|
|
@ -752,6 +752,11 @@ namespace CalculatorManagerTest
|
|||
|
||||
Command commands10[] = { Command::ModeProgrammer, Command::Command1, Command::CommandRORC, Command::CommandRORC, Command::CommandNULL };
|
||||
TestDriver::Test(L"-9,223,372,036,854,775,808", L"RoR(RoR(1))", commands10, true, false);
|
||||
|
||||
Command commands11[] = { Command::ModeProgrammer, Command::CommandDec, Command::Command4, Command::Command2, Command::Command9, Command::Command4,
|
||||
Command::Command9, Command::Command6, Command::Command7, Command::Command2, Command::Command9, Command::Command6,
|
||||
Command::CommandDIV, Command::Command2, Command::Command5, Command::Command5, Command::CommandEQU, Command::CommandNULL };
|
||||
TestDriver::Test(L"16,843,009", L"4294967296 \x00F7 255=", commands11, true, false);
|
||||
}
|
||||
|
||||
void CalculatorManagerTest::CalculatorManagerTestMemory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue