is there any advantage to using this code
double x; double square = pow(x,2);
instead of this?
double x; double square = x*
Not only is x*x clearer it certainly will be at least as fast as pow(x,2).
x*x
pow(x,2)