ad1

Sunday, November 15, 2015

Power::"indet" "Indeterminate expression 0^0 encountered

When using mathematica, the following error encountered:
Power::"indet" "Indeterminate expression 0^0 encountered
That is, Mathematica treats the expression 0^0 (that is Power[0,0]) as indeterminate.
There is an easy solution:
Unprotect[Power];
Power[0,0]=1;
Protect[Power];
After this, 0^0 will evaluate to 1. If you need this in numerical calculations, you should define Power[0 | 0., 0 | 0.] = 1;, which also includes the case 0.^0..

No comments:

Post a Comment