I'm doing a scientific calculator. This calculator has several mathematical functions for the number entered. For example, in this code the square root is calculated:
if (e.getSource() == boton[11]) {
if (!entrada.equals("") && !entrada.equals("0")) {
double valor = Double.parseDouble(entrada);
valor = Math.sqrt(valor);
entrada = "" + valor;
}
}
What I need is to show the result of the factorial calculation in the following code:
if( e.getSource() == boton[3]) {
double valor = Double.parseDouble(entrada);
//qué hacer
}
Would someone help me please?