Update Calc Engine for new functions needed for keyboard refresh (#662)
* Update Calc Engine to Support New Functionality * Address PR comments * Address PR comments
This commit is contained in:
		@@ -261,6 +261,11 @@ void CalcInput::SetDecimalSymbol(wchar_t decSymbol)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool CalcInput::IsEmpty()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_base.IsEmpty() && !m_hasExponent && m_exponent.IsEmpty() && !m_hasDecimal;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wstring CalcInput::ToString(uint32_t radix)
 | 
					wstring CalcInput::ToString(uint32_t radix)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    // In theory both the base and exponent could be C_NUM_MAX_DIGITS long.
 | 
					    // In theory both the base and exponent could be C_NUM_MAX_DIGITS long.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,14 +11,14 @@ bool IsOpInRange(OpCode op, uint32_t x, uint32_t y)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool IsBinOpCode(OpCode opCode)
 | 
					bool IsBinOpCode(OpCode opCode)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return IsOpInRange(opCode, IDC_AND, IDC_PWR);
 | 
					    return IsOpInRange(opCode, IDC_AND, IDC_PWR) || IsOpInRange(opCode, IDC_BINARYEXTENDEDFIRST, IDC_BINARYEXTENDEDLAST);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// WARNING: IDC_SIGN is a special unary op but still this doesn't catch this. Caller has to be aware
 | 
					// WARNING: IDC_SIGN is a special unary op but still this doesn't catch this. Caller has to be aware
 | 
				
			||||||
// of it and catch it themselves or not needing this
 | 
					// of it and catch it themselves or not needing this
 | 
				
			||||||
bool IsUnaryOpCode(OpCode opCode)
 | 
					bool IsUnaryOpCode(OpCode opCode)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return IsOpInRange(opCode, IDC_UNARYFIRST, IDC_UNARYLAST);
 | 
					    return (IsOpInRange(opCode, IDC_UNARYFIRST, IDC_UNARYLAST) || IsOpInRange(opCode, IDC_UNARYEXTENDEDFIRST, IDC_UNARYEXTENDEDLAST));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool IsDigitOpCode(OpCode opCode)
 | 
					bool IsDigitOpCode(OpCode opCode)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -120,12 +120,12 @@ void CHistoryCollector::RemoveLastOpndFromHistory()
 | 
				
			|||||||
    // This will not restore the m_lastBinOpStartIndex, as it isn't possible to remove that also later
 | 
					    // This will not restore the m_lastBinOpStartIndex, as it isn't possible to remove that also later
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CHistoryCollector::AddBinOpToHistory(int nOpCode, bool fNoRepetition)
 | 
					void CHistoryCollector::AddBinOpToHistory(int nOpCode, bool isIntegerMode, bool fNoRepetition)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int iCommandEnd = AddCommand(std::make_shared<CBinaryCommand>(nOpCode));
 | 
					    int iCommandEnd = AddCommand(std::make_shared<CBinaryCommand>(nOpCode));
 | 
				
			||||||
    m_lastBinOpStartIndex = IchAddSzToEquationSz(L" ", -1);
 | 
					    m_lastBinOpStartIndex = IchAddSzToEquationSz(L" ", -1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    IchAddSzToEquationSz(CCalcEngine::OpCodeToString(nOpCode), iCommandEnd);
 | 
					    IchAddSzToEquationSz(CCalcEngine::OpCodeToBinaryString(nOpCode, isIntegerMode), iCommandEnd);
 | 
				
			||||||
    IchAddSzToEquationSz(L" ", -1);
 | 
					    IchAddSzToEquationSz(L" ", -1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (fNoRepetition)
 | 
					    if (fNoRepetition)
 | 
				
			||||||
@@ -138,14 +138,14 @@ void CHistoryCollector::AddBinOpToHistory(int nOpCode, bool fNoRepetition)
 | 
				
			|||||||
// This is expected to be called when a binary op in the last say 1+2+ is changing to another one say 1+2* (+ changed to *)
 | 
					// This is expected to be called when a binary op in the last say 1+2+ is changing to another one say 1+2* (+ changed to *)
 | 
				
			||||||
// It needs to know by this change a Precedence inversion happened. i.e. previous op was lower or equal to its previous op, but the new
 | 
					// It needs to know by this change a Precedence inversion happened. i.e. previous op was lower or equal to its previous op, but the new
 | 
				
			||||||
// one isn't. (Eg. 1*2* to 1*2^). It can add explicit brackets to ensure the precedence is inverted. (Eg. (1*2) ^)
 | 
					// one isn't. (Eg. 1*2* to 1*2^). It can add explicit brackets to ensure the precedence is inverted. (Eg. (1*2) ^)
 | 
				
			||||||
void CHistoryCollector::ChangeLastBinOp(int nOpCode, bool fPrecInvToHigher)
 | 
					void CHistoryCollector::ChangeLastBinOp(int nOpCode, bool fPrecInvToHigher, bool isIntgerMode)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    TruncateEquationSzFromIch(m_lastBinOpStartIndex);
 | 
					    TruncateEquationSzFromIch(m_lastBinOpStartIndex);
 | 
				
			||||||
    if (fPrecInvToHigher)
 | 
					    if (fPrecInvToHigher)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        EnclosePrecInversionBrackets();
 | 
					        EnclosePrecInversionBrackets();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    AddBinOpToHistory(nOpCode);
 | 
					    AddBinOpToHistory(nOpCode, isIntgerMode);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void CHistoryCollector::PushLastOpndStart(int ichOpndStart)
 | 
					void CHistoryCollector::PushLastOpndStart(int ichOpndStart)
 | 
				
			||||||
@@ -266,6 +266,30 @@ void CHistoryCollector::AddUnaryOpToHistory(int nOpCode, bool fInv, ANGLE_TYPE a
 | 
				
			|||||||
                command = fInv ? static_cast<int>(CalculationManager::Command::CommandATANH) : IDC_TANH;
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandATANH) : IDC_TANH;
 | 
				
			||||||
                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					            case IDC_SEC:
 | 
				
			||||||
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandASEC) : IDC_SEC;
 | 
				
			||||||
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(static_cast<int>(angleOpCode), command);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case IDC_CSC:
 | 
				
			||||||
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandACSC) : IDC_CSC;
 | 
				
			||||||
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(static_cast<int>(angleOpCode), command);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case IDC_COT:
 | 
				
			||||||
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandACOT) : IDC_COT;
 | 
				
			||||||
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(static_cast<int>(angleOpCode), command);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case IDC_SECH:
 | 
				
			||||||
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandASECH) : IDC_SECH;
 | 
				
			||||||
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case IDC_CSCH:
 | 
				
			||||||
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandACSCH) : IDC_CSCH;
 | 
				
			||||||
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case IDC_COTH:
 | 
				
			||||||
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandACOTH) : IDC_COTH;
 | 
				
			||||||
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
            case IDC_LN:
 | 
					            case IDC_LN:
 | 
				
			||||||
                command = fInv ? static_cast<int>(CalculationManager::Command::CommandPOWE) : IDC_LN;
 | 
					                command = fInv ? static_cast<int>(CalculationManager::Command::CommandPOWE) : IDC_LN;
 | 
				
			||||||
                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
					                spExpressionCommand = std::make_shared<CUnaryCommand>(command);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
#include "Header Files/CalcEngine.h"
 | 
					#include "Header Files/CalcEngine.h"
 | 
				
			||||||
#include "Header Files/CalcUtils.h"
 | 
					#include "Header Files/CalcUtils.h"
 | 
				
			||||||
 | 
					#include "NumberFormattingUtils.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using namespace std;
 | 
					using namespace std;
 | 
				
			||||||
using namespace CalcEngine;
 | 
					using namespace CalcEngine;
 | 
				
			||||||
@@ -28,8 +29,13 @@ namespace
 | 
				
			|||||||
    // 0 is returned. Higher the number, higher the precedence of the operator.
 | 
					    // 0 is returned. Higher the number, higher the precedence of the operator.
 | 
				
			||||||
    int NPrecedenceOfOp(int nopCode)
 | 
					    int NPrecedenceOfOp(int nopCode)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        static uint8_t rgbPrec[] = { 0, 0,        IDC_OR, 0,       IDC_XOR, 0,       IDC_AND, 1,       IDC_ADD, 2,       IDC_SUB, 2,        IDC_RSHF,
 | 
					        static uint16_t rgbPrec[] = {
 | 
				
			||||||
                                     3, IDC_LSHF, 3,      IDC_MOD, 3,       IDC_DIV, 3,       IDC_MUL, 3,       IDC_PWR, 4,       IDC_ROOT, 4 };
 | 
					            0,0, IDC_OR,0, IDC_XOR,0,
 | 
				
			||||||
 | 
					            IDC_AND,1, IDC_NAND,1, IDC_NOR,1,
 | 
				
			||||||
 | 
					            IDC_ADD,2, IDC_SUB,2,
 | 
				
			||||||
 | 
					            IDC_RSHF,3, IDC_LSHF,3, IDC_RSHFL,3,
 | 
				
			||||||
 | 
					            IDC_MOD,3, IDC_DIV,3, IDC_MUL,3,
 | 
				
			||||||
 | 
					            IDC_PWR,4, IDC_ROOT,4, IDC_LOGBASEX,4 };
 | 
				
			||||||
        unsigned int iPrec;
 | 
					        unsigned int iPrec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        iPrec = 0;
 | 
					        iPrec = 0;
 | 
				
			||||||
@@ -124,9 +130,18 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
    // Toggle Record/Display mode if appropriate.
 | 
					    // Toggle Record/Display mode if appropriate.
 | 
				
			||||||
    if (m_bRecord)
 | 
					    if (m_bRecord)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (IsOpInRange(wParam, IDC_AND, IDC_MMINUS) || IsOpInRange(wParam, IDC_OPENP, IDC_CLOSEP) || IsOpInRange(wParam, IDM_HEX, IDM_BIN)
 | 
					        if (IsBinOpCode(wParam) ||
 | 
				
			||||||
            || IsOpInRange(wParam, IDM_QWORD, IDM_BYTE) || IsOpInRange(wParam, IDM_DEG, IDM_GRAD)
 | 
					            IsUnaryOpCode(wParam) ||
 | 
				
			||||||
            || IsOpInRange(wParam, IDC_BINEDITSTART, IDC_BINEDITSTART + 63) || (IDC_INV == wParam) || (IDC_SIGN == wParam && 10 != m_radix))
 | 
					            IsOpInRange(wParam, IDC_FE, IDC_MMINUS) ||
 | 
				
			||||||
 | 
					            IsOpInRange(wParam, IDC_OPENP, IDC_CLOSEP) ||
 | 
				
			||||||
 | 
					            IsOpInRange(wParam, IDM_HEX, IDM_BIN) ||
 | 
				
			||||||
 | 
					            IsOpInRange(wParam, IDM_QWORD, IDM_BYTE) ||
 | 
				
			||||||
 | 
					            IsOpInRange(wParam, IDM_DEG, IDM_GRAD) ||
 | 
				
			||||||
 | 
					            IsOpInRange(wParam, IDC_BINEDITSTART, IDC_BINEDITEND) ||
 | 
				
			||||||
 | 
					            (IDC_INV == wParam) ||
 | 
				
			||||||
 | 
					            (IDC_SIGN == wParam && 10 != m_radix) ||
 | 
				
			||||||
 | 
					            (IDC_RAND == wParam) ||
 | 
				
			||||||
 | 
					            (IDC_EULER == wParam))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_bRecord = false;
 | 
					            m_bRecord = false;
 | 
				
			||||||
            m_currentVal = m_input.ToRational(m_radix, m_precision);
 | 
					            m_currentVal = m_input.ToRational(m_radix, m_precision);
 | 
				
			||||||
@@ -193,7 +208,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
                    m_nPrevOpCode = 0; // Once the precedence inversion has put additional brackets, its no longer required
 | 
					                    m_nPrevOpCode = 0; // Once the precedence inversion has put additional brackets, its no longer required
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            m_HistoryCollector.ChangeLastBinOp(m_nOpCode, fPrecInvToHigher);
 | 
					            m_HistoryCollector.ChangeLastBinOp(m_nOpCode, fPrecInvToHigher, m_fIntegerMode);
 | 
				
			||||||
            DisplayAnnounceBinaryOperator();
 | 
					            DisplayAnnounceBinaryOperator();
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -270,10 +285,9 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        DisplayAnnounceBinaryOperator();
 | 
					        DisplayAnnounceBinaryOperator();
 | 
				
			||||||
 | 
					 | 
				
			||||||
        m_lastVal = m_currentVal;
 | 
					        m_lastVal = m_currentVal;
 | 
				
			||||||
        m_nOpCode = (int)wParam;
 | 
					        m_nOpCode = (int)wParam;
 | 
				
			||||||
        m_HistoryCollector.AddBinOpToHistory(m_nOpCode);
 | 
					        m_HistoryCollector.AddBinOpToHistory(m_nOpCode, m_fIntegerMode);
 | 
				
			||||||
        m_bNoPrevEqu = m_bChangeOp = true;
 | 
					        m_bNoPrevEqu = m_bChangeOp = true;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -303,7 +317,8 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
            m_HistoryCollector.AddUnaryOpToHistory((int)wParam, m_bInv, m_angletype);
 | 
					            m_HistoryCollector.AddUnaryOpToHistory((int)wParam, m_bInv, m_angletype);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ((wParam == IDC_SIN) || (wParam == IDC_COS) || (wParam == IDC_TAN) || (wParam == IDC_SINH) || (wParam == IDC_COSH) || (wParam == IDC_TANH))
 | 
					        if ((wParam == IDC_SIN) || (wParam == IDC_COS) || (wParam == IDC_TAN) || (wParam == IDC_SINH) || (wParam == IDC_COSH) || (wParam == IDC_TANH)
 | 
				
			||||||
 | 
					            || (wParam == IDC_SEC) || (wParam == IDC_CSC) || (wParam == IDC_COT) || (wParam == IDC_SECH) || (wParam == IDC_CSCH) || (wParam == IDC_COTH))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (IsCurrentTooBigForTrig())
 | 
					            if (IsCurrentTooBigForTrig())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@@ -330,9 +345,13 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
        /* reset the m_bInv flag and indicators if it is set
 | 
					        /* reset the m_bInv flag and indicators if it is set
 | 
				
			||||||
        and have been used */
 | 
					        and have been used */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (m_bInv
 | 
					        if (m_bInv &&
 | 
				
			||||||
            && ((wParam == IDC_CHOP) || (wParam == IDC_SIN) || (wParam == IDC_COS) || (wParam == IDC_TAN) || (wParam == IDC_LN) || (wParam == IDC_DMS)
 | 
					                ((wParam == IDC_CHOP) || (wParam == IDC_SIN) || (wParam == IDC_COS) ||
 | 
				
			||||||
                || (wParam == IDC_DEGREES) || (wParam == IDC_SINH) || (wParam == IDC_COSH) || (wParam == IDC_TANH)))
 | 
					                (wParam == IDC_TAN) || (wParam == IDC_LN) || (wParam == IDC_DMS) ||
 | 
				
			||||||
 | 
					                (wParam == IDC_DEGREES) || (wParam == IDC_SINH) || (wParam == IDC_COSH) ||
 | 
				
			||||||
 | 
					                (wParam == IDC_TANH) || (wParam == IDC_SEC) || (wParam == IDC_CSC) ||
 | 
				
			||||||
 | 
					                (wParam == IDC_COT) || (wParam == IDC_SECH) || (wParam == IDC_CSCH) ||
 | 
				
			||||||
 | 
					                (wParam == IDC_COTH)))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_bInv = false;
 | 
					            m_bInv = false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -341,10 +360,10 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Tiny binary edit windows clicked. Toggle that bit and update display
 | 
					    // Tiny binary edit windows clicked. Toggle that bit and update display
 | 
				
			||||||
    if (IsOpInRange(wParam, IDC_BINEDITSTART, IDC_BINEDITSTART + 63))
 | 
					    if (IsOpInRange(wParam, IDC_BINEDITSTART, IDC_BINEDITEND))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // Same reasoning as for unary operators. We need to seed it previous number
 | 
					        // Same reasoning as for unary operators. We need to seed it previous number
 | 
				
			||||||
        if (m_nLastCom >= IDC_AND && m_nLastCom <= IDC_PWR)
 | 
					        if (IsBinOpCode(m_nLastCom))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_currentVal = m_lastVal;
 | 
					            m_currentVal = m_lastVal;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -377,6 +396,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
        m_precedenceOpCount = m_nTempCom = m_nLastCom = m_nOpCode = 0;
 | 
					        m_precedenceOpCount = m_nTempCom = m_nLastCom = m_nOpCode = 0;
 | 
				
			||||||
        m_nPrevOpCode = 0;
 | 
					        m_nPrevOpCode = 0;
 | 
				
			||||||
        m_bNoPrevEqu = true;
 | 
					        m_bNoPrevEqu = true;
 | 
				
			||||||
 | 
					        m_carryBit = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* clear the parenthesis status box indicator, this will not be
 | 
					        /* clear the parenthesis status box indicator, this will not be
 | 
				
			||||||
        cleared for CENTR */
 | 
					        cleared for CENTR */
 | 
				
			||||||
@@ -700,7 +720,6 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
    case IDC_MCLEAR:
 | 
					    case IDC_MCLEAR:
 | 
				
			||||||
        m_memoryValue = make_unique<Rational>(wParam == IDC_STORE ? TruncateNumForIntMath(m_currentVal) : 0);
 | 
					        m_memoryValue = make_unique<Rational>(wParam == IDC_STORE ? TruncateNumForIntMath(m_currentVal) : 0);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    case IDC_PI:
 | 
					    case IDC_PI:
 | 
				
			||||||
        if (!m_fIntegerMode)
 | 
					        if (!m_fIntegerMode)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -713,7 +732,43 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        HandleErrorCommand(wParam);
 | 
					        HandleErrorCommand(wParam);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					    case IDC_RAND:
 | 
				
			||||||
 | 
					        if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            CheckAndAddLastBinOpToHistory(); // rand is like entering the number
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            wstringstream str;
 | 
				
			||||||
 | 
					            str << fixed << setprecision(m_precision) << GenerateRandomNumber();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            auto rat = StringToRat(false, str.str(), false, L"", m_radix, m_precision);
 | 
				
			||||||
 | 
					            if (rat != nullptr)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                m_currentVal = Rational{ rat };
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                m_currentVal = Rational{ 0 };
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            destroyrat(rat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            DisplayNum();
 | 
				
			||||||
 | 
					            m_bInv = false;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        HandleErrorCommand(wParam);
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					    case IDC_EULER:
 | 
				
			||||||
 | 
					        if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            CheckAndAddLastBinOpToHistory(); // e is like entering the number
 | 
				
			||||||
 | 
					            m_currentVal = Rational{ rat_exp };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            DisplayNum();
 | 
				
			||||||
 | 
					            m_bInv = false;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        HandleErrorCommand(wParam);
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
    case IDC_FE:
 | 
					    case IDC_FE:
 | 
				
			||||||
        // Toggle exponential notation display.
 | 
					        // Toggle exponential notation display.
 | 
				
			||||||
        m_nFE = NUMOBJ_FMT(!(int)m_nFE);
 | 
					        m_nFE = NUMOBJ_FMT(!(int)m_nFE);
 | 
				
			||||||
@@ -761,7 +816,7 @@ void CCalcEngine::ResolveHighestPrecedenceOperation()
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            m_currentVal = m_holdVal;
 | 
					            m_currentVal = m_holdVal;
 | 
				
			||||||
            DisplayNum(); // to update the m_numberString
 | 
					            DisplayNum(); // to update the m_numberString
 | 
				
			||||||
            m_HistoryCollector.AddBinOpToHistory(m_nOpCode, false);
 | 
					            m_HistoryCollector.AddBinOpToHistory(m_nOpCode, m_fIntegerMode, false);
 | 
				
			||||||
            m_HistoryCollector.AddOpndToHistory(m_numberString, m_currentVal); // Adding the repeated last op to history
 | 
					            m_HistoryCollector.AddOpndToHistory(m_numberString, m_currentVal); // Adding the repeated last op to history
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -863,11 +918,14 @@ struct FunctionNameElement
 | 
				
			|||||||
    wstring gradString;
 | 
					    wstring gradString;
 | 
				
			||||||
    wstring inverseGradString; // Will fall back to gradString if empty
 | 
					    wstring inverseGradString; // Will fall back to gradString if empty
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    wstring programmerModeString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool hasAngleStrings = ((!radString.empty()) || (!inverseRadString.empty()) || (!gradString.empty()) || (!inverseGradString.empty()));
 | 
					    bool hasAngleStrings = ((!radString.empty()) || (!inverseRadString.empty()) || (!gradString.empty()) || (!inverseGradString.empty()));
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Table for each unary operator
 | 
					// Table for each unary operator
 | 
				
			||||||
static const std::unordered_map<int, FunctionNameElement> unaryOperatorStringTable = {
 | 
					static const std::unordered_map<int, FunctionNameElement> operatorStringTable =
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    { IDC_CHOP, { L"", SIDS_FRAC } },
 | 
					    { IDC_CHOP, { L"", SIDS_FRAC } },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    { IDC_SIN, { SIDS_SIND, SIDS_ASIND, SIDS_SINR, SIDS_ASINR, SIDS_SING, SIDS_ASING } },
 | 
					    { IDC_SIN, { SIDS_SIND, SIDS_ASIND, SIDS_SINR, SIDS_ASINR, SIDS_SING, SIDS_ASING } },
 | 
				
			||||||
@@ -878,6 +936,14 @@ static const std::unordered_map<int, FunctionNameElement> unaryOperatorStringTab
 | 
				
			|||||||
    { IDC_COSH, { L"", SIDS_ACOSH } },
 | 
					    { IDC_COSH, { L"", SIDS_ACOSH } },
 | 
				
			||||||
    { IDC_TANH, { L"", SIDS_ATANH } },
 | 
					    { IDC_TANH, { L"", SIDS_ATANH } },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { IDC_SEC, { SIDS_SECD, SIDS_ASECD, SIDS_SECR, SIDS_ASECR, SIDS_SECG, SIDS_ASECG } },
 | 
				
			||||||
 | 
					    { IDC_CSC, { SIDS_CSCD, SIDS_ACSCD, SIDS_CSCR, SIDS_ACSCR, SIDS_CSCG, SIDS_ACSCG } },
 | 
				
			||||||
 | 
					    { IDC_COT, { SIDS_COTD, SIDS_ACOTD, SIDS_COTR, SIDS_ACOTR, SIDS_COTG, SIDS_ACOTG } },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { IDC_SECH, { SIDS_SECH, SIDS_ASECH } },
 | 
				
			||||||
 | 
					    { IDC_CSCH, { SIDS_CSCH, SIDS_ACSCH } },
 | 
				
			||||||
 | 
					    { IDC_COTH, { SIDS_COTH, SIDS_ACOTH } },
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    { IDC_LN, { L"", SIDS_POWE } },
 | 
					    { IDC_LN, { L"", SIDS_POWE } },
 | 
				
			||||||
    { IDC_SQR, { SIDS_SQR } },
 | 
					    { IDC_SQR, { SIDS_SQR } },
 | 
				
			||||||
    { IDC_CUB, { SIDS_CUBE } },
 | 
					    { IDC_CUB, { SIDS_CUBE } },
 | 
				
			||||||
@@ -885,7 +951,19 @@ static const std::unordered_map<int, FunctionNameElement> unaryOperatorStringTab
 | 
				
			|||||||
    { IDC_REC, { SIDS_RECIPROC } },
 | 
					    { IDC_REC, { SIDS_RECIPROC } },
 | 
				
			||||||
    { IDC_DMS, { L"", SIDS_DEGREES } },
 | 
					    { IDC_DMS, { L"", SIDS_DEGREES } },
 | 
				
			||||||
    { IDC_SIGN, { SIDS_NEGATE } },
 | 
					    { IDC_SIGN, { SIDS_NEGATE } },
 | 
				
			||||||
    { IDC_DEGREES, { SIDS_DEGREES } }
 | 
					    { IDC_DEGREES, { SIDS_DEGREES } },
 | 
				
			||||||
 | 
					    { IDC_POW2, { SIDS_TWOPOWX } },
 | 
				
			||||||
 | 
					    { IDC_LOGBASEX, { SIDS_LOGBASEX } },
 | 
				
			||||||
 | 
					    { IDC_ABS, { SIDS_ABS } },
 | 
				
			||||||
 | 
					    { IDC_CEIL, { SIDS_CEIL } },
 | 
				
			||||||
 | 
					    { IDC_FLOOR, { SIDS_FLOOR } },
 | 
				
			||||||
 | 
					    { IDC_NAND, { SIDS_NAND } },
 | 
				
			||||||
 | 
					    { IDC_NOR, { SIDS_NOR } },
 | 
				
			||||||
 | 
					    { IDC_RSHFL, { SIDS_RSH } },
 | 
				
			||||||
 | 
					    { IDC_RORC, { SIDS_ROR } },
 | 
				
			||||||
 | 
					    { IDC_ROLC, { SIDS_ROL } },
 | 
				
			||||||
 | 
					    { IDC_CUBEROOT, {SIDS_CUBEROOT} },
 | 
				
			||||||
 | 
					    { IDC_MOD, {SIDS_MOD, L"", L"", L"", L"", L"", SIDS_PROGRAMMER_MOD} },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wstring_view CCalcEngine::OpCodeToUnaryString(int nOpCode, bool fInv, ANGLE_TYPE angletype)
 | 
					wstring_view CCalcEngine::OpCodeToUnaryString(int nOpCode, bool fInv, ANGLE_TYPE angletype)
 | 
				
			||||||
@@ -893,7 +971,7 @@ wstring_view CCalcEngine::OpCodeToUnaryString(int nOpCode, bool fInv, ANGLE_TYPE
 | 
				
			|||||||
    // Try to lookup the ID in the UFNE table
 | 
					    // Try to lookup the ID in the UFNE table
 | 
				
			||||||
    wstring ids = L"";
 | 
					    wstring ids = L"";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (auto pair = unaryOperatorStringTable.find(nOpCode); pair != unaryOperatorStringTable.end())
 | 
					    if (auto pair = operatorStringTable.find(nOpCode); pair != operatorStringTable.end())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        const FunctionNameElement& element = pair->second;
 | 
					        const FunctionNameElement& element = pair->second;
 | 
				
			||||||
        if (!element.hasAngleStrings || ANGLE_DEG == angletype)
 | 
					        if (!element.hasAngleStrings || ANGLE_DEG == angletype)
 | 
				
			||||||
@@ -941,6 +1019,32 @@ wstring_view CCalcEngine::OpCodeToUnaryString(int nOpCode, bool fInv, ANGLE_TYPE
 | 
				
			|||||||
    return OpCodeToString(nOpCode);
 | 
					    return OpCodeToString(nOpCode);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					wstring_view CCalcEngine::OpCodeToBinaryString(int nOpCode, bool isIntegerMode)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    // Try to lookup the ID in the UFNE table
 | 
				
			||||||
 | 
					    wstring ids = L"";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (auto pair = operatorStringTable.find(nOpCode); pair != operatorStringTable.end())
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (isIntegerMode && !pair->second.programmerModeString.empty())
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            ids = pair->second.programmerModeString;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            ids = pair->second.degreeString;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!ids.empty())
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return GetString(ids);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // If we didn't find an ID in the table, use the op code.
 | 
				
			||||||
 | 
					    return OpCodeToString(nOpCode);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool CCalcEngine::IsCurrentTooBigForTrig()
 | 
					bool CCalcEngine::IsCurrentTooBigForTrig()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return m_currentVal >= m_maxTrigonometricNum;
 | 
					    return m_currentVal >= m_maxTrigonometricNum;
 | 
				
			||||||
@@ -1007,3 +1111,14 @@ wstring CCalcEngine::GetStringForDisplay(Rational const& rat, uint32_t radix)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					double CCalcEngine::GenerateRandomNumber()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (m_randomGeneratorEngine == nullptr)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        random_device rd;
 | 
				
			||||||
 | 
					        m_randomGeneratorEngine = std::make_unique<std::mt19937>(rd());
 | 
				
			||||||
 | 
					        m_distr = std::make_unique<std::uniform_real_distribution<>>(0, 1);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return (*m_distr.get())(*m_randomGeneratorEngine.get());
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,8 +46,8 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Rotate Left with hi bit wrapped over to lo bit
 | 
					 | 
				
			||||||
        case IDC_ROL:
 | 
					        case IDC_ROL:
 | 
				
			||||||
 | 
					        case IDC_ROLC:
 | 
				
			||||||
            if (m_fIntegerMode)
 | 
					            if (m_fIntegerMode)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                result = Integer(rat);
 | 
					                result = Integer(rat);
 | 
				
			||||||
@@ -55,14 +55,23 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
 | 
				
			|||||||
                uint64_t w64Bits = result.ToUInt64_t();
 | 
					                uint64_t w64Bits = result.ToUInt64_t();
 | 
				
			||||||
                uint64_t msb = (w64Bits >> (m_dwWordBitWidth - 1)) & 1;
 | 
					                uint64_t msb = (w64Bits >> (m_dwWordBitWidth - 1)) & 1;
 | 
				
			||||||
                w64Bits <<= 1;  // LShift by 1
 | 
					                w64Bits <<= 1;  // LShift by 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (op == IDC_ROL)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    w64Bits |= msb; // Set the prev Msb as the current Lsb
 | 
					                    w64Bits |= msb; // Set the prev Msb as the current Lsb
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    w64Bits |= m_carryBit; // Set the carry bit as the LSB
 | 
				
			||||||
 | 
					                    m_carryBit = msb; // Store the msb as the next carry bit
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                result = w64Bits;
 | 
					                result = w64Bits;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Rotate right with lo bit wrapped over to hi bit
 | 
					 | 
				
			||||||
        case IDC_ROR:
 | 
					        case IDC_ROR:
 | 
				
			||||||
 | 
					        case IDC_RORC:
 | 
				
			||||||
            if (m_fIntegerMode)
 | 
					            if (m_fIntegerMode)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                result = Integer(rat);
 | 
					                result = Integer(rat);
 | 
				
			||||||
@@ -70,7 +79,16 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
 | 
				
			|||||||
                uint64_t w64Bits = result.ToUInt64_t();
 | 
					                uint64_t w64Bits = result.ToUInt64_t();
 | 
				
			||||||
                uint64_t lsb = ((w64Bits & 0x01) == 1) ? 1 : 0;
 | 
					                uint64_t lsb = ((w64Bits & 0x01) == 1) ? 1 : 0;
 | 
				
			||||||
                w64Bits >>= 1; // RShift by 1
 | 
					                w64Bits >>= 1; // RShift by 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (op == IDC_ROR)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    w64Bits |= (lsb << (m_dwWordBitWidth - 1));
 | 
					                    w64Bits |= (lsb << (m_dwWordBitWidth - 1));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    w64Bits |= (m_carryBit << (m_dwWordBitWidth - 1));
 | 
				
			||||||
 | 
					                    m_carryBit = lsb;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                result = w64Bits;
 | 
					                result = w64Bits;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -133,6 +151,48 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_SEC:
 | 
				
			||||||
 | 
					            if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = m_bInv ? ACos(Invert(rat), m_angletype) : Invert(Cos(rat, m_angletype));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_CSC:
 | 
				
			||||||
 | 
					            if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = m_bInv ? ASin(Invert(rat), m_angletype) : Invert(Sin(rat, m_angletype));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_COT:
 | 
				
			||||||
 | 
					            if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = m_bInv ? ATan(Invert(rat), m_angletype) : Invert(Tan(rat, m_angletype));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_SECH:
 | 
				
			||||||
 | 
					            if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = m_bInv ? ACosh(Invert(rat)) : Invert(Cosh(rat));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_CSCH:
 | 
				
			||||||
 | 
					            if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = m_bInv ? ASinh(Invert(rat)) : Invert(Sinh(rat));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_COTH:
 | 
				
			||||||
 | 
					            if (!m_fIntegerMode)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = m_bInv ? ATanh(Invert(rat)) : Invert(Tanh(rat));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case IDC_REC: /* Reciprocal. */
 | 
					        case IDC_REC: /* Reciprocal. */
 | 
				
			||||||
            result = Invert(rat);
 | 
					            result = Invert(rat);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
@@ -158,6 +218,10 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
 | 
				
			|||||||
            result = Pow(10, rat);
 | 
					            result = Pow(10, rat);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_POW2:
 | 
				
			||||||
 | 
					            result = Pow(2, rat);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case IDC_LN: /* Functions for natural log. */
 | 
					        case IDC_LN: /* Functions for natural log. */
 | 
				
			||||||
            result = m_bInv ? Exp(rat) : Log(rat);
 | 
					            result = m_bInv ? Exp(rat) : Log(rat);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
@@ -202,6 +266,18 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        case IDC_CEIL:
 | 
				
			||||||
 | 
					            result = (Frac(rat) > 0) ? Integer(rat + 1) : Integer(rat);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_FLOOR:
 | 
				
			||||||
 | 
					            result = (Frac(rat) < 0) ? Integer(rat - 1 ) : Integer(rat);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_ABS:
 | 
				
			||||||
 | 
					            result = Abs(rat);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        } // end switch( op )
 | 
					        } // end switch( op )
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    catch (uint32_t nErrCode)
 | 
					    catch (uint32_t nErrCode)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,14 @@ CalcEngine::Rational CCalcEngine::DoOperation(int operation, CalcEngine::Rationa
 | 
				
			|||||||
            result ^= rhs;
 | 
					            result ^= rhs;
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_NAND:
 | 
				
			||||||
 | 
					            result = (result & rhs) ^ m_chopNumbers[m_numwidth];
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_NOR:
 | 
				
			||||||
 | 
					            result = (result | rhs) ^ m_chopNumbers[m_numwidth];
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case IDC_RSHF:
 | 
					        case IDC_RSHF:
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (m_fIntegerMode && result >= m_dwWordBitWidth) // Lsh/Rsh >= than current word size is always 0
 | 
					            if (m_fIntegerMode && result >= m_dwWordBitWidth) // Lsh/Rsh >= than current word size is always 0
 | 
				
			||||||
@@ -52,7 +60,16 @@ CalcEngine::Rational CCalcEngine::DoOperation(int operation, CalcEngine::Rationa
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        case IDC_RSHFL:
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (m_fIntegerMode && result >= m_dwWordBitWidth) // Lsh/Rsh >= than current word size is always 0
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                throw CALC_E_NORESULT;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            result = rhs >> result;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        case IDC_LSHF:
 | 
					        case IDC_LSHF:
 | 
				
			||||||
            if (m_fIntegerMode && result >= m_dwWordBitWidth) // Lsh/Rsh >= than current word size is always 0
 | 
					            if (m_fIntegerMode && result >= m_dwWordBitWidth) // Lsh/Rsh >= than current word size is always 0
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@@ -140,6 +157,10 @@ CalcEngine::Rational CCalcEngine::DoOperation(int operation, CalcEngine::Rationa
 | 
				
			|||||||
        case IDC_ROOT: // Calculates rhs to the result(th) root.
 | 
					        case IDC_ROOT: // Calculates rhs to the result(th) root.
 | 
				
			||||||
            result = Root(rhs, result);
 | 
					            result = Root(rhs, result);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case IDC_LOGBASEX:
 | 
				
			||||||
 | 
					            result = (Log(result) / Log(rhs));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    catch (uint32_t dwErrCode)
 | 
					    catch (uint32_t dwErrCode)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -75,6 +75,11 @@ namespace CalculationManager
 | 
				
			|||||||
        m_displayCallback->MemoryItemChanged(indexOfMemory);
 | 
					        m_displayCallback->MemoryItemChanged(indexOfMemory);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    void CalculatorManager::InputChanged()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_displayCallback->InputChanged();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Call the callback function using passed in IDisplayHelper.
 | 
					    /// Call the callback function using passed in IDisplayHelper.
 | 
				
			||||||
    /// Used to set the expression display value on ViewModel
 | 
					    /// Used to set the expression display value on ViewModel
 | 
				
			||||||
@@ -240,6 +245,7 @@ namespace CalculationManager
 | 
				
			|||||||
                m_savedCommands.push_back(MapCommandForSerialize(command));
 | 
					                m_savedCommands.push_back(MapCommandForSerialize(command));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            m_savedDegreeMode = m_currentDegreeMode;
 | 
					            m_savedDegreeMode = m_currentDegreeMode;
 | 
				
			||||||
 | 
					            InputChanged();
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -283,6 +289,30 @@ namespace CalculationManager
 | 
				
			|||||||
            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandTANH));
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandTANH));
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					        case Command::CommandASEC:
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandSEC));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case Command::CommandACSC:
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCSC));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case Command::CommandACOT:
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCOT));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case Command::CommandASECH:
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandSECH));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case Command::CommandACSCH:
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCSCH));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case Command::CommandACOTH:
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
 | 
				
			||||||
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCOTH));
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
        case Command::CommandFE:
 | 
					        case Command::CommandFE:
 | 
				
			||||||
            m_isExponentialFormat = !m_isExponentialFormat;
 | 
					            m_isExponentialFormat = !m_isExponentialFormat;
 | 
				
			||||||
            [[fallthrough]];
 | 
					            [[fallthrough]];
 | 
				
			||||||
@@ -290,6 +320,8 @@ namespace CalculationManager
 | 
				
			|||||||
            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(command));
 | 
					            m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(command));
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        InputChanged();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
@@ -330,6 +362,7 @@ namespace CalculationManager
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        m_currentCalculatorEngine->PersistedMemObject(m_persistedPrimaryValue);
 | 
					        m_currentCalculatorEngine->PersistedMemObject(m_persistedPrimaryValue);
 | 
				
			||||||
        m_currentCalculatorEngine->ProcessCommand(IDC_RECALL);
 | 
					        m_currentCalculatorEngine->ProcessCommand(IDC_RECALL);
 | 
				
			||||||
 | 
					        InputChanged();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
@@ -376,6 +409,7 @@ namespace CalculationManager
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        this->MemorizedNumberSelect(indexOfMemory);
 | 
					        this->MemorizedNumberSelect(indexOfMemory);
 | 
				
			||||||
        m_currentCalculatorEngine->ProcessCommand(IDC_RECALL);
 | 
					        m_currentCalculatorEngine->ProcessCommand(IDC_RECALL);
 | 
				
			||||||
 | 
					        InputChanged();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
@@ -638,6 +672,11 @@ namespace CalculationManager
 | 
				
			|||||||
        return m_currentCalculatorEngine->FInRecordingState() ? true : false;
 | 
					        return m_currentCalculatorEngine->FInRecordingState() ? true : false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bool CalculatorManager::IsInputEmpty()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return m_currentCalculatorEngine->IsInputEmpty();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void CalculatorManager::SetInHistoryItemLoadMode(_In_ bool isHistoryItemLoadMode)
 | 
					    void CalculatorManager::SetInHistoryItemLoadMode(_In_ bool isHistoryItemLoadMode)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        m_inHistoryItemLoadMode = isHistoryItemLoadMode;
 | 
					        m_inHistoryItemLoadMode = isHistoryItemLoadMode;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,7 +101,7 @@ namespace CalculationManager
 | 
				
			|||||||
        void MaxDigitsReached() override;
 | 
					        void MaxDigitsReached() override;
 | 
				
			||||||
        void BinaryOperatorReceived() override;
 | 
					        void BinaryOperatorReceived() override;
 | 
				
			||||||
        void MemoryItemChanged(unsigned int indexOfMemory) override;
 | 
					        void MemoryItemChanged(unsigned int indexOfMemory) override;
 | 
				
			||||||
 | 
					        void InputChanged() override;
 | 
				
			||||||
        CalculatorManager(ICalcDisplay* displayCallback, IResourceProvider* resourceProvider);
 | 
					        CalculatorManager(ICalcDisplay* displayCallback, IResourceProvider* resourceProvider);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        void Reset(bool clearMemory = true);
 | 
					        void Reset(bool clearMemory = true);
 | 
				
			||||||
@@ -118,6 +118,7 @@ namespace CalculationManager
 | 
				
			|||||||
        void MemorizedNumberClearAll();
 | 
					        void MemorizedNumberClearAll();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bool IsEngineRecording();
 | 
					        bool IsEngineRecording();
 | 
				
			||||||
 | 
					        bool IsInputEmpty();
 | 
				
			||||||
        std::vector<unsigned char> GetSavedCommands()
 | 
					        std::vector<unsigned char> GetSavedCommands()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return m_savedCommands;
 | 
					            return m_savedCommands;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,6 +97,7 @@ namespace CalculationManager
 | 
				
			|||||||
        CommandROL = 99,
 | 
					        CommandROL = 99,
 | 
				
			||||||
        CommandROR = 100,
 | 
					        CommandROR = 100,
 | 
				
			||||||
        CommandCOM = 101,
 | 
					        CommandCOM = 101,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CommandSIN = 102,
 | 
					        CommandSIN = 102,
 | 
				
			||||||
        CommandCOS = 103,
 | 
					        CommandCOS = 103,
 | 
				
			||||||
        CommandTAN = 104,
 | 
					        CommandTAN = 104,
 | 
				
			||||||
@@ -151,6 +152,34 @@ namespace CalculationManager
 | 
				
			|||||||
        CommandINV = 146,
 | 
					        CommandINV = 146,
 | 
				
			||||||
        CommandSET_RESULT = 147,
 | 
					        CommandSET_RESULT = 147,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CommandSEC = 400,
 | 
				
			||||||
 | 
					        CommandASEC = 401,
 | 
				
			||||||
 | 
					        CommandCSC = 402,
 | 
				
			||||||
 | 
					        CommandACSC = 403,
 | 
				
			||||||
 | 
					        CommandCOT = 404,
 | 
				
			||||||
 | 
					        CommandACOT = 405,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CommandSECH = 406,
 | 
				
			||||||
 | 
					        CommandASECH = 407,
 | 
				
			||||||
 | 
					        CommandCSCH = 408,
 | 
				
			||||||
 | 
					        CommandACSCH = 409,
 | 
				
			||||||
 | 
					        CommandCOTH = 410,
 | 
				
			||||||
 | 
					        CommandACOTH = 411,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CommandPOW2 = 412,  // 2 ^ x
 | 
				
			||||||
 | 
					        CommandAbs = 413,
 | 
				
			||||||
 | 
					        CommandFloor = 414,
 | 
				
			||||||
 | 
					        CommandCeil = 415,
 | 
				
			||||||
 | 
					        CommandROLC = 416,
 | 
				
			||||||
 | 
					        CommandRORC = 417,
 | 
				
			||||||
 | 
					        CommandLogBaseX = 500,
 | 
				
			||||||
 | 
					        CommandNand = 501,
 | 
				
			||||||
 | 
					        CommandNor = 502,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CommandRSHFL = 505,
 | 
				
			||||||
 | 
					        CommandRand = 600,
 | 
				
			||||||
 | 
					        CommandEuler = 601,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CommandAnd = 86,
 | 
					        CommandAnd = 86,
 | 
				
			||||||
        CommandOR = 87,
 | 
					        CommandOR = 87,
 | 
				
			||||||
        CommandNot = 101,
 | 
					        CommandNot = 101,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -81,6 +81,7 @@
 | 
				
			|||||||
#define IDC_ROL 99
 | 
					#define IDC_ROL 99
 | 
				
			||||||
#define IDC_ROR 100
 | 
					#define IDC_ROR 100
 | 
				
			||||||
#define IDC_COM 101
 | 
					#define IDC_COM 101
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IDC_SIN 102
 | 
					#define IDC_SIN 102
 | 
				
			||||||
#define IDC_COS 103
 | 
					#define IDC_COS 103
 | 
				
			||||||
#define IDC_TAN 104
 | 
					#define IDC_TAN 104
 | 
				
			||||||
@@ -136,7 +137,44 @@
 | 
				
			|||||||
#define IDC_INV 146
 | 
					#define IDC_INV 146
 | 
				
			||||||
#define IDC_SET_RESULT 147
 | 
					#define IDC_SET_RESULT 147
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IDC_LASTCONTROL IDC_SET_RESULT
 | 
					#define IDC_STRING_MAPPED_VALUES  400
 | 
				
			||||||
 | 
					#define IDC_UNARYEXTENDEDFIRST  IDC_STRING_MAPPED_VALUES
 | 
				
			||||||
 | 
					#define IDC_SEC          400 // Secant
 | 
				
			||||||
 | 
					// 401 reserved for inverse
 | 
				
			||||||
 | 
					#define IDC_CSC          402 // Cosecant
 | 
				
			||||||
 | 
					// 403 reserved for inverse
 | 
				
			||||||
 | 
					#define IDC_COT          404 // Cotangent
 | 
				
			||||||
 | 
					// 405 reserved for inverse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_SECH          406 //Hyperbolic Secant
 | 
				
			||||||
 | 
					// 407 reserved for inverse
 | 
				
			||||||
 | 
					#define IDC_CSCH          408 //Hyperbolic Cosecant
 | 
				
			||||||
 | 
					// 409 reserved for inverse
 | 
				
			||||||
 | 
					#define IDC_COTH          410 //Hyperbolic Cotangent
 | 
				
			||||||
 | 
					// 411 reserved for inverse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_POW2          412 // 2 ^ x
 | 
				
			||||||
 | 
					#define IDC_ABS           413 // Absolute Value
 | 
				
			||||||
 | 
					#define IDC_FLOOR         414 // Floor
 | 
				
			||||||
 | 
					#define IDC_CEIL          415 // Ceiling
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_ROLC          416 // Rotate Left Circular
 | 
				
			||||||
 | 
					#define IDC_RORC          417 // Rotate Right Circular
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_UNARYEXTENDEDLAST  IDC_RORC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_LASTCONTROL IDC_CEIL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_BINARYEXTENDEDFIRST 500
 | 
				
			||||||
 | 
					#define IDC_LOGBASEX            500 // logx(y)
 | 
				
			||||||
 | 
					#define IDC_NAND                501 // Nand
 | 
				
			||||||
 | 
					#define IDC_NOR                 502 // Nor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_RSHFL               505 //Right Shift Logical
 | 
				
			||||||
 | 
					#define IDC_BINARYEXTENDEDLAST  IDC_RSHFL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define IDC_RAND            600 // Random
 | 
				
			||||||
 | 
					#define IDC_EULER           601 // e Constant
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IDC_BINEDITSTART 700
 | 
					#define IDC_BINEDITSTART 700
 | 
				
			||||||
#define IDC_BINPOS0 700
 | 
					#define IDC_BINPOS0 700
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@
 | 
				
			|||||||
*
 | 
					*
 | 
				
			||||||
\****************************************************************************/
 | 
					\****************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <random>
 | 
				
			||||||
#include "CCommand.h"
 | 
					#include "CCommand.h"
 | 
				
			||||||
#include "EngineStrings.h"
 | 
					#include "EngineStrings.h"
 | 
				
			||||||
#include "../Command.h"
 | 
					#include "../Command.h"
 | 
				
			||||||
@@ -68,6 +69,10 @@ public:
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        return m_bError;
 | 
					        return m_bError;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    bool IsInputEmpty()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return m_input.IsEmpty() && (m_numberString.empty() || m_numberString == L"0");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    bool FInRecordingState()
 | 
					    bool FInRecordingState()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return m_bRecord;
 | 
					        return m_bRecord;
 | 
				
			||||||
@@ -103,6 +108,7 @@ public:
 | 
				
			|||||||
        return GetString(IdStrFromCmdId(nOpCode));
 | 
					        return GetString(IdStrFromCmdId(nOpCode));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    static std::wstring_view OpCodeToUnaryString(int nOpCode, bool fInv, ANGLE_TYPE angletype);
 | 
					    static std::wstring_view OpCodeToUnaryString(int nOpCode, bool fInv, ANGLE_TYPE angletype);
 | 
				
			||||||
 | 
					    static std::wstring_view OpCodeToBinaryString(int nOpCode, bool isIntegerMode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    bool m_fPrecedence;
 | 
					    bool m_fPrecedence;
 | 
				
			||||||
@@ -147,6 +153,11 @@ private:
 | 
				
			|||||||
    NUM_WIDTH m_numwidth;                    // one of qword, dword, word or byte mode.
 | 
					    NUM_WIDTH m_numwidth;                    // one of qword, dword, word or byte mode.
 | 
				
			||||||
    int32_t m_dwWordBitWidth;                // # of bits in currently selected word size
 | 
					    int32_t m_dwWordBitWidth;                // # of bits in currently selected word size
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    std::unique_ptr<std::mt19937> m_randomGeneratorEngine;
 | 
				
			||||||
 | 
					    std::unique_ptr<std::uniform_real_distribution<>> m_distr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    uint64_t m_carryBit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CHistoryCollector m_HistoryCollector; // Accumulator of each line of history as various commands are processed
 | 
					    CHistoryCollector m_HistoryCollector; // Accumulator of each line of history as various commands are processed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::array<CalcEngine::Rational, NUM_WIDTH_LENGTH> m_chopNumbers;      // word size enforcement
 | 
					    std::array<CalcEngine::Rational, NUM_WIDTH_LENGTH> m_chopNumbers;      // word size enforcement
 | 
				
			||||||
@@ -171,6 +182,7 @@ private:
 | 
				
			|||||||
    void SetRadixTypeAndNumWidth(RADIX_TYPE radixtype, NUM_WIDTH numwidth);
 | 
					    void SetRadixTypeAndNumWidth(RADIX_TYPE radixtype, NUM_WIDTH numwidth);
 | 
				
			||||||
    int32_t DwWordBitWidthFromeNumWidth(NUM_WIDTH numwidth);
 | 
					    int32_t DwWordBitWidthFromeNumWidth(NUM_WIDTH numwidth);
 | 
				
			||||||
    uint32_t NRadixFromRadixType(RADIX_TYPE radixtype);
 | 
					    uint32_t NRadixFromRadixType(RADIX_TYPE radixtype);
 | 
				
			||||||
 | 
					    double GenerateRandomNumber();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool TryToggleBit(CalcEngine::Rational& rat, uint32_t wbitno);
 | 
					    bool TryToggleBit(CalcEngine::Rational& rat, uint32_t wbitno);
 | 
				
			||||||
    void CheckAndAddLastBinOpToHistory(bool addToHistory = true);
 | 
					    void CheckAndAddLastBinOpToHistory(bool addToHistory = true);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,6 +66,7 @@ namespace CalcEngine
 | 
				
			|||||||
        bool TryBeginExponent();
 | 
					        bool TryBeginExponent();
 | 
				
			||||||
        void Backspace();
 | 
					        void Backspace();
 | 
				
			||||||
        void SetDecimalSymbol(wchar_t decSymbol);
 | 
					        void SetDecimalSymbol(wchar_t decSymbol);
 | 
				
			||||||
 | 
					        bool IsEmpty();
 | 
				
			||||||
        std::wstring ToString(uint32_t radix);
 | 
					        std::wstring ToString(uint32_t radix);
 | 
				
			||||||
        Rational ToRational(uint32_t radix, int32_t precision);
 | 
					        Rational ToRational(uint32_t radix, int32_t precision);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -87,7 +87,6 @@ inline constexpr auto SIDS_XPOW3 = L"32";
 | 
				
			|||||||
inline constexpr auto SIDS_NFACTORIAL = L"33";
 | 
					inline constexpr auto SIDS_NFACTORIAL = L"33";
 | 
				
			||||||
inline constexpr auto SIDS_RECIPROCAL = L"34";
 | 
					inline constexpr auto SIDS_RECIPROCAL = L"34";
 | 
				
			||||||
inline constexpr auto SIDS_DMS = L"35";
 | 
					inline constexpr auto SIDS_DMS = L"35";
 | 
				
			||||||
inline constexpr auto SIDS_CUBEROOT = L"36";
 | 
					 | 
				
			||||||
inline constexpr auto SIDS_POWTEN = L"37";
 | 
					inline constexpr auto SIDS_POWTEN = L"37";
 | 
				
			||||||
inline constexpr auto SIDS_PERCENT = L"38";
 | 
					inline constexpr auto SIDS_PERCENT = L"38";
 | 
				
			||||||
inline constexpr auto SIDS_SCIENTIFIC_NOTATION = L"39";
 | 
					inline constexpr auto SIDS_SCIENTIFIC_NOTATION = L"39";
 | 
				
			||||||
@@ -172,9 +171,44 @@ inline constexpr auto SIDS_ERR_UNEX_END = L"117";
 | 
				
			|||||||
inline constexpr auto SIDS_ERR_SG_INV_ERROR = L"118";
 | 
					inline constexpr auto SIDS_ERR_SG_INV_ERROR = L"118";
 | 
				
			||||||
inline constexpr auto SIDS_ERR_INPUT_OVERFLOW = L"119";
 | 
					inline constexpr auto SIDS_ERR_INPUT_OVERFLOW = L"119";
 | 
				
			||||||
inline constexpr auto SIDS_ERR_OUTPUT_OVERFLOW = L"120";
 | 
					inline constexpr auto SIDS_ERR_OUTPUT_OVERFLOW = L"120";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_SECD = L"SecDeg";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_SECR = L"SecRad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_SECG = L"SecGrad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ASECD = L"InverseSecDeg";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ASECR = L"InverseSecRad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ASECG = L"InverseSecGrad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_CSCD = L"CscDeg";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_CSCR = L"CscRad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_CSCG = L"CscGrad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACSCD = L"InverseCscDeg";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACSCR = L"InverseCscRad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACSCG = L"InverseCscGrad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_COTD = L"CotDeg";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_COTR = L"CotRad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_COTG = L"CotGrad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACOTD = L"InverseCotDeg";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACOTR = L"InverseCotRad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACOTG = L"InverseCotGrad";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_SECH = L"Sech";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ASECH = L"InverseSech";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_CSCH = L"Csch";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACSCH = L"InverseCsch";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_COTH = L"Coth";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ACOTH = L"InverseCoth";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_TWOPOWX = L"TwoPowX";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_LOGBASEX = L"LogBaseX";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_ABS = L"Abs";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_FLOOR = L"Floor";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_CEIL = L"Ceil";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_NAND = L"Nand";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_NOR = L"Nor";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_CUBEROOT = L"CubeRoot";
 | 
				
			||||||
 | 
					inline constexpr auto SIDS_PROGRAMMER_MOD = L"ProgrammerMod";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Include the resource key ID from above into this vector to load it into memory for the engine to use
 | 
					// Include the resource key ID from above into this vector to load it into memory for the engine to use
 | 
				
			||||||
inline constexpr std::array<std::wstring_view, 120> g_sids = { SIDS_PLUS_MINUS,
 | 
					inline constexpr std::array<std::wstring_view, 152> g_sids =
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    SIDS_PLUS_MINUS,
 | 
				
			||||||
    SIDS_C,
 | 
					    SIDS_C,
 | 
				
			||||||
    SIDS_CE,
 | 
					    SIDS_CE,
 | 
				
			||||||
    SIDS_BACKSPACE,
 | 
					    SIDS_BACKSPACE,
 | 
				
			||||||
@@ -210,7 +244,6 @@ inline constexpr std::array<std::wstring_view, 120> g_sids = { SIDS_PLUS_MINUS,
 | 
				
			|||||||
    SIDS_NFACTORIAL,
 | 
					    SIDS_NFACTORIAL,
 | 
				
			||||||
    SIDS_RECIPROCAL,
 | 
					    SIDS_RECIPROCAL,
 | 
				
			||||||
    SIDS_DMS,
 | 
					    SIDS_DMS,
 | 
				
			||||||
                                                               SIDS_CUBEROOT,
 | 
					 | 
				
			||||||
    SIDS_POWTEN,
 | 
					    SIDS_POWTEN,
 | 
				
			||||||
    SIDS_PERCENT,
 | 
					    SIDS_PERCENT,
 | 
				
			||||||
    SIDS_SCIENTIFIC_NOTATION,
 | 
					    SIDS_SCIENTIFIC_NOTATION,
 | 
				
			||||||
@@ -293,4 +326,38 @@ inline constexpr std::array<std::wstring_view, 120> g_sids = { SIDS_PLUS_MINUS,
 | 
				
			|||||||
    SIDS_ERR_UNEX_END,
 | 
					    SIDS_ERR_UNEX_END,
 | 
				
			||||||
    SIDS_ERR_SG_INV_ERROR,
 | 
					    SIDS_ERR_SG_INV_ERROR,
 | 
				
			||||||
    SIDS_ERR_INPUT_OVERFLOW,
 | 
					    SIDS_ERR_INPUT_OVERFLOW,
 | 
				
			||||||
                                                               SIDS_ERR_OUTPUT_OVERFLOW };
 | 
					    SIDS_ERR_OUTPUT_OVERFLOW,
 | 
				
			||||||
 | 
					    SIDS_SECD,
 | 
				
			||||||
 | 
					    SIDS_SECG,
 | 
				
			||||||
 | 
					    SIDS_SECR,
 | 
				
			||||||
 | 
					    SIDS_ASECD,
 | 
				
			||||||
 | 
					    SIDS_ASECR,
 | 
				
			||||||
 | 
					    SIDS_ASECG,
 | 
				
			||||||
 | 
					    SIDS_CSCD,
 | 
				
			||||||
 | 
					    SIDS_CSCR,
 | 
				
			||||||
 | 
					    SIDS_CSCG,
 | 
				
			||||||
 | 
					    SIDS_ACSCD,
 | 
				
			||||||
 | 
					    SIDS_ACSCR,
 | 
				
			||||||
 | 
					    SIDS_ACSCG,
 | 
				
			||||||
 | 
					    SIDS_COTD,
 | 
				
			||||||
 | 
					    SIDS_COTR,
 | 
				
			||||||
 | 
					    SIDS_COTG,
 | 
				
			||||||
 | 
					    SIDS_ACOTD,
 | 
				
			||||||
 | 
					    SIDS_ACOTR,
 | 
				
			||||||
 | 
					    SIDS_ACOTG,
 | 
				
			||||||
 | 
					    SIDS_SECH,
 | 
				
			||||||
 | 
					    SIDS_ASECH,
 | 
				
			||||||
 | 
					    SIDS_CSCH,
 | 
				
			||||||
 | 
					    SIDS_ACSCH,
 | 
				
			||||||
 | 
					    SIDS_COTH,
 | 
				
			||||||
 | 
					    SIDS_ACOTH,
 | 
				
			||||||
 | 
					    SIDS_TWOPOWX,
 | 
				
			||||||
 | 
					    SIDS_LOGBASEX,
 | 
				
			||||||
 | 
					    SIDS_ABS,
 | 
				
			||||||
 | 
					    SIDS_FLOOR,
 | 
				
			||||||
 | 
					    SIDS_CEIL,
 | 
				
			||||||
 | 
					    SIDS_NAND,
 | 
				
			||||||
 | 
					    SIDS_NOR,
 | 
				
			||||||
 | 
					    SIDS_CUBEROOT,
 | 
				
			||||||
 | 
					    SIDS_PROGRAMMER_MOD,
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,8 +21,8 @@ public:
 | 
				
			|||||||
    ~CHistoryCollector();
 | 
					    ~CHistoryCollector();
 | 
				
			||||||
    void AddOpndToHistory(std::wstring_view numStr, CalcEngine::Rational const& rat, bool fRepetition = false);
 | 
					    void AddOpndToHistory(std::wstring_view numStr, CalcEngine::Rational const& rat, bool fRepetition = false);
 | 
				
			||||||
    void RemoveLastOpndFromHistory();
 | 
					    void RemoveLastOpndFromHistory();
 | 
				
			||||||
    void AddBinOpToHistory(int nOpCode, bool fNoRepetition = true);
 | 
					    void AddBinOpToHistory(int nOpCode, bool isIntgerMode, bool fNoRepetition = true);
 | 
				
			||||||
    void ChangeLastBinOp(int nOpCode, bool fPrecInvToHigher);
 | 
					    void ChangeLastBinOp(int nOpCode, bool fPrecInvToHigher, bool isIntgerMode);
 | 
				
			||||||
    void AddUnaryOpToHistory(int nOpCode, bool fInv, ANGLE_TYPE angletype);
 | 
					    void AddUnaryOpToHistory(int nOpCode, bool fInv, ANGLE_TYPE angletype);
 | 
				
			||||||
    void AddOpenBraceToHistory();
 | 
					    void AddOpenBraceToHistory();
 | 
				
			||||||
    void AddCloseBraceToHistory();
 | 
					    void AddCloseBraceToHistory();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,4 +22,5 @@ public:
 | 
				
			|||||||
    virtual void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) = 0;
 | 
					    virtual void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) = 0;
 | 
				
			||||||
    virtual void SetMemorizedNumbers(const std::vector<std::wstring>& memorizedNumbers) = 0;
 | 
					    virtual void SetMemorizedNumbers(const std::vector<std::wstring>& memorizedNumbers) = 0;
 | 
				
			||||||
    virtual void MemoryItemChanged(unsigned int indexOfMemory) = 0;
 | 
					    virtual void MemoryItemChanged(unsigned int indexOfMemory) = 0;
 | 
				
			||||||
 | 
					    virtual void InputChanged() = 0;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,3 +22,5 @@
 | 
				
			|||||||
#include <winerror.h>
 | 
					#include <winerror.h>
 | 
				
			||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
#include <math.h>
 | 
					#include <math.h>
 | 
				
			||||||
 | 
					#include <random>
 | 
				
			||||||
 | 
					#include <iomanip>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -136,3 +136,14 @@ void CalculatorDisplay::MemoryItemChanged(unsigned int indexOfMemory)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void CalculatorDisplay::InputChanged()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (m_callbackReference != nullptr)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            calcVM->OnInputChanged();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,7 @@ namespace CalculatorApp
 | 
				
			|||||||
        void MaxDigitsReached() override;
 | 
					        void MaxDigitsReached() override;
 | 
				
			||||||
        void BinaryOperatorReceived() override;
 | 
					        void BinaryOperatorReceived() override;
 | 
				
			||||||
        void MemoryItemChanged(unsigned int indexOfMemory) override;
 | 
					        void MemoryItemChanged(unsigned int indexOfMemory) override;
 | 
				
			||||||
 | 
					        void InputChanged() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
        Platform::WeakReference m_callbackReference;
 | 
					        Platform::WeakReference m_callbackReference;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1026,6 +1026,11 @@ NumbersAndOperatorsEnum StandardCalculatorViewModel::MapCharacterToButtonId(cons
 | 
				
			|||||||
    return mappedValue;
 | 
					    return mappedValue;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void StandardCalculatorViewModel::OnInputChanged()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    IsInputEmpty = m_standardCalculatorManager.IsInputEmpty();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void StandardCalculatorViewModel::OnMemoryButtonPressed()
 | 
					void StandardCalculatorViewModel::OnMemoryButtonPressed()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    m_standardCalculatorManager.MemorizeNumber();
 | 
					    m_standardCalculatorManager.MemorizeNumber();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -76,6 +76,7 @@ namespace CalculatorApp
 | 
				
			|||||||
            OBSERVABLE_PROPERTY_RW(bool, AreAlwaysOnTopResultsUpdated);
 | 
					            OBSERVABLE_PROPERTY_RW(bool, AreAlwaysOnTopResultsUpdated);
 | 
				
			||||||
            OBSERVABLE_PROPERTY_RW(bool, AreHistoryShortcutsEnabled);
 | 
					            OBSERVABLE_PROPERTY_RW(bool, AreHistoryShortcutsEnabled);
 | 
				
			||||||
            OBSERVABLE_PROPERTY_RW(bool, AreProgrammerRadixOperatorsEnabled);
 | 
					            OBSERVABLE_PROPERTY_RW(bool, AreProgrammerRadixOperatorsEnabled);
 | 
				
			||||||
 | 
					            OBSERVABLE_PROPERTY_RW(bool, IsInputEmpty);
 | 
				
			||||||
            OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::Automation::NarratorAnnouncement ^, Announcement);
 | 
					            OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::Automation::NarratorAnnouncement ^, Announcement);
 | 
				
			||||||
            OBSERVABLE_PROPERTY_R(unsigned int, OpenParenthesisCount);
 | 
					            OBSERVABLE_PROPERTY_R(unsigned int, OpenParenthesisCount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -122,13 +123,8 @@ namespace CalculatorApp
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            static property Platform::String ^ IsBitFlipCheckedPropertyName
 | 
					            static property Platform::String
 | 
				
			||||||
            {
 | 
					                ^ IsBitFlipCheckedPropertyName { Platform::String ^ get() { return Platform::StringReference(L"IsBitFlipChecked"); } }
 | 
				
			||||||
                Platform::String ^ get()
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    return Platform::StringReference(L"IsBitFlipChecked");
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            property bool IsBinaryBitFlippingEnabled
 | 
					            property bool IsBinaryBitFlippingEnabled
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@@ -223,13 +219,8 @@ namespace CalculatorApp
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            static property Platform::String ^ IsProgrammerPropertyName
 | 
					            static property Platform::String
 | 
				
			||||||
            {
 | 
					                ^ IsProgrammerPropertyName { Platform::String ^ get() { return Platform::StringReference(L"IsProgrammer"); } }
 | 
				
			||||||
                Platform::String ^ get()
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    return Platform::StringReference(L"IsProgrammer");
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            property bool IsAlwaysOnTop
 | 
					            property bool IsAlwaysOnTop
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@@ -365,6 +356,7 @@ namespace CalculatorApp
 | 
				
			|||||||
            void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
 | 
					            void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
 | 
				
			||||||
            void OnPinUnpinCommand(Platform::Object ^ parameter);
 | 
					            void OnPinUnpinCommand(Platform::Object ^ parameter);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            void OnInputChanged();
 | 
				
			||||||
            void SetPrimaryDisplay(_In_ std::wstring const& displayString, _In_ bool isError);
 | 
					            void SetPrimaryDisplay(_In_ std::wstring const& displayString, _In_ bool isError);
 | 
				
			||||||
            void DisplayPasteError();
 | 
					            void DisplayPasteError();
 | 
				
			||||||
            void SetTokens(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const& tokens);
 | 
					            void SetTokens(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const& tokens);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<root>
 | 
					<root>
 | 
				
			||||||
  <!-- 
 | 
					  <!-- 
 | 
				
			||||||
    Microsoft ResX Schema 
 | 
					    Microsoft ResX Schema 
 | 
				
			||||||
@@ -198,7 +198,7 @@
 | 
				
			|||||||
    <comment>{Locked}The string that represents the function</comment>
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="21" xml:space="preserve">
 | 
					  <data name="21" xml:space="preserve">
 | 
				
			||||||
    <value>Not</value>
 | 
					    <value>NOT</value>
 | 
				
			||||||
    <comment>{Locked}The string that represents the function</comment>
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="22" xml:space="preserve">
 | 
					  <data name="22" xml:space="preserve">
 | 
				
			||||||
@@ -274,7 +274,7 @@
 | 
				
			|||||||
    <comment>{Locked}The string that represents the function</comment>
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="6" xml:space="preserve">
 | 
					  <data name="6" xml:space="preserve">
 | 
				
			||||||
    <value>And</value>
 | 
					    <value>AND</value>
 | 
				
			||||||
    <comment>{Locked}The string that represents the function</comment>
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="66" xml:space="preserve">
 | 
					  <data name="66" xml:space="preserve">
 | 
				
			||||||
@@ -338,7 +338,7 @@
 | 
				
			|||||||
    <comment>{Locked}The string that represents the function</comment>
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="8" xml:space="preserve">
 | 
					  <data name="8" xml:space="preserve">
 | 
				
			||||||
    <value>Xor</value>
 | 
					    <value>XOR</value>
 | 
				
			||||||
    <comment>{Locked}The string that represents the function</comment>
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="80" xml:space="preserve">
 | 
					  <data name="80" xml:space="preserve">
 | 
				
			||||||
@@ -417,4 +417,136 @@
 | 
				
			|||||||
    <value>Cannot divide by zero</value>
 | 
					    <value>Cannot divide by zero</value>
 | 
				
			||||||
    <comment>Error string shown when a divide by zero condition happens during the calculation</comment>
 | 
					    <comment>Error string shown when a divide by zero condition happens during the calculation</comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="SecDeg" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>sec₀</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="SecRad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>secᵣ</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="SecGrad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>sec₉</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseSecDeg" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>sec₀⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseSecRad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>secᵣ⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseSecGrad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>sec₉⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CscDeg" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>csc₀</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CscRad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cscᵣ</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CscGrad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>csc₉</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCscDeg" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>csc₀⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCscRad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cscᵣ⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCscGrad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>csc₉⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CotDeg" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cot₀</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CotRad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cotᵣ</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CotGrad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cot₉</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCotDeg" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cot₀⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCotRad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cotᵣ⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCotGrad" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cot₉⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Sech" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>sech</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseSech" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>sech⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Csch" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>csch</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCsch" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>csch⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Coth" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>coth</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="InverseCoth" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>coth⁻¹</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="TwoPowX" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>2^</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="LogBaseX" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>base log</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Abs" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>abs</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Ceil" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>ceil</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Floor" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>floor</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Nand" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>NAND</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="Nor" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>NOR</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="CubeRoot" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>cuberoot</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
 | 
					  <data name="ProgrammerMod" xml:space="preserve">
 | 
				
			||||||
 | 
					    <value>%</value>
 | 
				
			||||||
 | 
					    <comment>{Locked}The string that represents the function</comment>
 | 
				
			||||||
 | 
					  </data>
 | 
				
			||||||
</root>
 | 
					</root>
 | 
				
			||||||
@@ -97,6 +97,10 @@ namespace CalculatorManagerTest
 | 
				
			|||||||
            m_maxDigitsCalledCount++;
 | 
					            m_maxDigitsCalledCount++;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        void InputChanged() override
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int GetMaxDigitsCalledCount()
 | 
					        int GetMaxDigitsCalledCount()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return m_maxDigitsCalledCount;
 | 
					            return m_maxDigitsCalledCount;
 | 
				
			||||||
@@ -179,6 +183,8 @@ namespace CalculatorManagerTest
 | 
				
			|||||||
        TEST_METHOD(CalculatorManagerTestScientificError);
 | 
					        TEST_METHOD(CalculatorManagerTestScientificError);
 | 
				
			||||||
        TEST_METHOD(CalculatorManagerTestScientificModeChange);
 | 
					        TEST_METHOD(CalculatorManagerTestScientificModeChange);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        TEST_METHOD(CalculatorManagerTestProgrammer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        TEST_METHOD(CalculatorManagerTestModeChange);
 | 
					        TEST_METHOD(CalculatorManagerTestModeChange);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        TEST_METHOD(CalculatorManagerTestMemory);
 | 
					        TEST_METHOD(CalculatorManagerTestMemory);
 | 
				
			||||||
@@ -495,9 +501,9 @@ namespace CalculatorManagerTest
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        Command commands5[] = { Command::Command8, Command::CommandCUB, Command::CommandNULL };
 | 
					        Command commands5[] = { Command::Command8, Command::CommandCUB, Command::CommandNULL };
 | 
				
			||||||
        TestDriver::Test(L"512", L"cube(8)", commands5, true, true);
 | 
					        TestDriver::Test(L"512", L"cube(8)", commands5, true, true);
 | 
				
			||||||
        /*
 | 
					
 | 
				
			||||||
        Command commands6[] = { Command::Command8, Command::CommandCUB, Command::CommandCUBEROOT, Command::CommandNULL };
 | 
					        Command commands6[] = { Command::Command8, Command::CommandCUB, Command::CommandCUBEROOT, Command::CommandNULL };
 | 
				
			||||||
                TestDriver::Test(L"8", L"cuberoot(cube(8))", commands6, true, true);*/
 | 
					        TestDriver::Test(L"8", L"cuberoot(cube(8))", commands6, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Command commands7[] = { Command::Command1, Command::Command0, Command::CommandLOG, Command::CommandNULL };
 | 
					        Command commands7[] = { Command::Command1, Command::Command0, Command::CommandLOG, Command::CommandNULL };
 | 
				
			||||||
        TestDriver::Test(L"1", L"log(10)", commands7, true, true);
 | 
					        TestDriver::Test(L"1", L"log(10)", commands7, true, true);
 | 
				
			||||||
@@ -552,6 +558,66 @@ namespace CalculatorManagerTest
 | 
				
			|||||||
        Command commands22[] = { Command::Command1, Command::Command0, Command::CommandPWR, Command::Command1, Command::CommandPNT, Command::Command2,
 | 
					        Command commands22[] = { Command::Command1, Command::Command0, Command::CommandPWR, Command::Command1, Command::CommandPNT, Command::Command2,
 | 
				
			||||||
                                 Command::Command3, Command::Command4, Command::Command5,   Command::Command6, Command::CommandADD, Command::CommandNULL };
 | 
					                                 Command::Command3, Command::Command4, Command::Command5,   Command::Command6, Command::CommandADD, Command::CommandNULL };
 | 
				
			||||||
        TestDriver::Test(L"17.161687912241792074207286679393", L"10 ^ 1.23456 + ", commands22, true, true);
 | 
					        TestDriver::Test(L"17.161687912241792074207286679393", L"10 ^ 1.23456 + ", commands22, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands23[] = { Command::Command1, Command::CommandSEC, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"1.0001523280439076654284264342126", L"sec\x2080(1)", commands23, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands24[] = { Command::Command1, Command::CommandCSC, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"57.298688498550183476612683735174", L"csc\x2080(1)", commands24, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands25[] = { Command::Command1, Command::CommandCOT, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"57.289961630759424687278147537113", L"cot\x2080(1)", commands25, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands26[] = { Command::Command1, Command::CommandASEC, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0", L"sec\x2080\x207B\x00B9(1)", commands26, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands27[] = { Command::Command1, Command::CommandACSC, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"90", L"csc\x2080\x207B\x00B9(1)", commands27, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands28[] = { Command::Command1, Command::CommandACOT, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"45", L"cot\x2080\x207B\x00B9(1)", commands28, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands29[] = { Command::Command1, Command::CommandSECH, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0.64805427366388539957497735322615", L"sech(1)", commands29, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands30[] = { Command::Command1, Command::CommandCSCH, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0.85091812823932154513384276328718", L"csch(1)", commands30, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands31[] = { Command::Command1, Command::CommandCOTH, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"1.3130352854993313036361612469308", L"coth(1)", commands31, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands32[] = { Command::Command1, Command::CommandASECH, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0", L"sech\x207B\x00B9(1)", commands32, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands33[] = { Command::Command1, Command::CommandACSCH, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0.88137358701954302523260932497979", L"csch\x207B\x00B9(1)", commands33, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands34[] = { Command::Command2, Command::CommandACOTH, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0.54930614433405484569762261846126", L"coth\x207B\x00B9(2)", commands34, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands35[] = { Command::Command8, Command::CommandPOW2, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"256", L"2^(8)", commands35);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands36[] = { Command::CommandRand, Command::CommandCeil, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"1", L"N/A", commands36);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands37[] = { Command::CommandRand, Command::CommandFloor, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0", L"N/A", commands37);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands38[] = { Command::CommandRand, Command::CommandSIGN, Command::CommandCeil, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0", L"N/A", commands38);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands39[] = { Command::CommandRand, Command::CommandSIGN, Command::CommandFloor, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"-1", L"N/A", commands39);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands40[] = { Command::Command3, Command::CommandPNT, Command::Command8, Command::CommandFloor, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"3", L"floor(3.8)", commands40);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands41[] = { Command::Command3, Command::CommandPNT, Command::Command8, Command::CommandCeil, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"4", L"ceil(3.8)", commands41);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands42[] = { Command::Command3, Command::CommandLogBaseX, Command::Command5, Command::CommandADD, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"1.464973520717927", L"3 base log 5 + ", commands42);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void CalculatorManagerTest::CalculatorManagerTestScientificParenthesis()
 | 
					    void CalculatorManagerTest::CalculatorManagerTestScientificParenthesis()
 | 
				
			||||||
@@ -651,6 +717,41 @@ namespace CalculatorManagerTest
 | 
				
			|||||||
        TestDriver::Test(L"0", L"", commands8, true, false);
 | 
					        TestDriver::Test(L"0", L"", commands8, true, false);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    void CalculatorManagerTest::CalculatorManagerTestProgrammer()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        Command commands1[] = { Command::ModeProgrammer, Command::Command5, Command::Command3, Command::CommandNand,
 | 
				
			||||||
 | 
					            Command::Command8, Command::Command3, Command::CommandAnd, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"-18", L"53 NAND 83 AND ", commands1, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands2[] = { Command::ModeProgrammer, Command::Command5, Command::Command3, Command::CommandNor,
 | 
				
			||||||
 | 
					            Command::Command8, Command::Command3, Command::CommandAnd, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"-120", L"53 NOR 83 AND ", commands2, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands3[] = { Command::ModeProgrammer, Command::Command5, Command::CommandLSHF,
 | 
				
			||||||
 | 
					            Command::Command1, Command::CommandAnd, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"10", L"5 Lsh 1 AND ", commands3, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands5[] = { Command::ModeProgrammer, Command::Command5, Command::CommandRSHFL,
 | 
				
			||||||
 | 
					            Command::Command1, Command::CommandAnd, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"2", L"5 Rsh 1 AND ", commands5, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands6[] = { Command::ModeProgrammer, Command::CommandBINPOS63, Command::CommandRSHF,
 | 
				
			||||||
 | 
					            Command::Command5, Command::Command6, Command::CommandAnd, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"-128", L"-9223372036854775808 Rsh 56 AND ", commands6, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands7[] = { Command::ModeProgrammer, Command::Command1, Command::CommandROL, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"2", L"RoL(1)", commands7, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands8[] = { Command::ModeProgrammer, Command::Command1, Command::CommandROR, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"-9,223,372,036,854,775,808", L"RoR(1)", commands8, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Command commands9[] = { Command::ModeProgrammer, Command::Command1, Command::CommandRORC, Command::CommandNULL };
 | 
				
			||||||
 | 
					        TestDriver::Test(L"0", L"RoR(1)", commands9, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        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);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void CalculatorManagerTest::CalculatorManagerTestMemory()
 | 
					    void CalculatorManagerTest::CalculatorManagerTestMemory()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Command scientificCalculatorTest52[] = { Command::Command1, Command::CommandSTORE, Command::CommandNULL };
 | 
					        Command scientificCalculatorTest52[] = { Command::Command1, Command::CommandSTORE, Command::CommandNULL };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user