public static void UserInput(string theDigit) { if (inNumber == false) { if (inDecimal == true) { currentX += "0."; inDecimal = false; } else { currentX += theDigit; } inNumber = true; } else { if (inDecimal == true && !currentX.Contains(".")) { currentX += "."; inDecimal = false; } currentX += theDigit; } RPN_Stack.PushNoUpdate(double.Parse(currentX)); Display.UpdateCurrentNumber(currentX); }
public static void Exponents() { double valueX = RPN_Stack.Pop(), valueY = RPN_Stack.Pop(); RPN_Stack.Push(Math.Pow(valueY, valueX)); }
public static void Multiplication() { double valueX = RPN_Stack.Pop(), valueY = RPN_Stack.Pop(); RPN_Stack.Push(valueY * valueX); }
public static void Division() { double valueX = RPN_Stack.Pop(), valueY = RPN_Stack.Pop(); RPN_Stack.Push(valueY / valueX); }
public static void Subtraction() { double valueX = RPN_Stack.Pop(), valueY = RPN_Stack.Pop(); RPN_Stack.Push(valueY - valueX); }
public static void Addition() { double valueX = RPN_Stack.Pop(); double valueY = RPN_Stack.Pop(); RPN_Stack.Push(valueY + valueX); }
public static void SwapXY() { double valueX = RPN_Stack.Pop(); double valueY = RPN_Stack.Pop(); RPN_Stack.Push(valueX); RPN_Stack.Push(valueY); }
public static void SquareRoot() { RPN_Stack.Push(Math.Sqrt(RPN_Stack.Pop())); }
public static void Reciprocal() { RPN_Stack.Push(1 / RPN_Stack.Pop()); }
public static void SwitchSigns() { RPN_Stack.Push(RPN_Stack.Pop() * -1); }
public static void XSquared() { RPN_Stack.Push(Math.Pow(RPN_Stack.Pop(), 2)); }
private void btnRollUp_Click(object sender, EventArgs e) { RPN_Stack.RollUp(); Input.ResetInput(); }
private void btnClearX_Click(object sender, EventArgs e) { RPN_Stack.ClearX(); Input.ResetInput(); }
private void btnEnter_Click(object sender, EventArgs e) { RPN_Stack.Push(0); Input.ResetInput(); }