private void Button_Click_Exponent(object sender, RoutedEventArgs e) { if (CalcController.CanPlaceOperator()) { CalcController.AddTextOperatorBox("^", InputBox.Text); CalcController.ClearInputBox(); } }
private void Button_Click_SquareRoot(object sender, RoutedEventArgs e) { if (CalcController.CanPlaceOperator()) { CalcController.AddTextOperatorBox("", $"√({InputBox.Text})"); CalcController.ClearInputBox(); } }
private void Button_Click_Plus(object sender, RoutedEventArgs e) { // Take what ever number is in the inputbox // place a "+" after it // add that stuff to the OperatorBox // Clear InputBox if (CalcController.CanPlaceOperator()) { CalcController.AddTextOperatorBox("+", InputBox.Text); CalcController.ClearInputBox(); } }
private void Button_Click_Factorial(object sender, RoutedEventArgs e) { // Also factorial max out at 3500... Because anything higher breaks stuff (I.e. that loop down their loops many many many times. Also overflows so) if (CalcController.InputBoxIsNotEmpty(InputBox) && int.Parse(InputBox.Text) > 3500) { CalcController.OverwriteInput("NaN"); } else if (CalcController.CanPlaceOperator()) { CalcController.AddTextOperatorBox("", $"!({InputBox.Text})"); CalcController.ClearInputBox(); } }