The following code leads to error message: "Runtime Error Last executed input: 1.00000, -2147483648"

However, if replacing the line about base case of the recursion "if (n==1) return x" with "if (n==0) return 1.0", then it becomes acceptable. I can't figure out why? It seems to me the two different base bases essentially the same.

```
double pow(double x, int n) {
if (n==0) return 1.0;
if (n<0)
return 1.0/pow0(x,-n);
else
return pow0(x,n);
}
double pow0(double x, int n) {
if (n==1) return x; //if (n==0) return 1.0;
double sub_result=pow0(x,n/2);
if (n%2==1){
return x*sub_result*sub_result;
}
else{
return sub_result*sub_result;
}
}
```