public static double pow(double a,double b)
Math.pow requires two double literals as input.
An integer literal is divided by integer literal give a result of integer literal.
int top=11;
int bottom=2;
System.out.println("top/bottom= "+top/bottom);
//--> top/bottom= 5 (the result is trancated)
Look at here for some rules
so Math.pow(5,1/2) gives result of 1.0d because 5 to power of 0 is 1. 1/2 gives 0.
Math.pow((double)a,1.0d/n));
A double literal divided by any literal number(except 0) give double result, so n need not to be casted--> (double)n