Is it the factorial?

public static double fact(double n){

if(n==0) return 1;

return fact(n-1)*n;

}

or you mean another function. Because what you posted won't even compile :)

public static double fact(double n){

if(n==0) return 1;

return fact(n-1)*n;

}

or you mean another function. Because what you posted won't even compile :)