New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
math/cmplx: cmplx.Pow(0, x) not consistent with math.Pow(0, x) #7583
Labels
Milestone
Comments
See also http://www.wolframalpha.com/input/?i=0^0 |
The math package is also wrong. Imagine you're plotting this: math.Pow(math.Exp(-1/x),x). For all values, including x=0, the value should be 1/e, of course, but instead we get 1 (and this has nothing to do with rounding errors, unlike, say, for x=1e-3). A non-answer (NaN) is probably better than a wrong answer in general. |
The math package is also wrong. Imagine you're plotting this: math.Pow(math.Exp(-1/x),x). For all values, including x=0, the value should be 1/e, of course, but instead we get 1 (and this has nothing to do with rounding errors, unlike, say, for x=1e-3). A non-answer (NaN) is probably better than a wrong answer in general. |
There is a long history (and controversy) of math.Pow(0, 0) == 1. Wikipedia's summary is at http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_power_of_zero . This issue is not about math.Pow, which isn't going to change. This issue is about cmplx.Pow. I tend to agree that cmplx.Pow(0, 0) should be NaN. |
This issue was closed by revision a9014ba. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by spoon.reloaded:
The text was updated successfully, but these errors were encountered: