-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
What should 0**I be? #16478
Comments
I think that the results should be nan. That is often the best value for a limit that does not exist. |
I think that the abs of these limits can be well defined: In [16]: abs(x**I).limit(x, 0)
Out[16]: 1
In [17]: abs(x**(1+I)).limit(x, 0)
Out[17]: 0
In [18]: abs(x**(-1+I)).limit(x, 0)
Out[18]: ∞ That would suggest:
|
I think that one should consider all values of a multi-valued function like |
I had considered that and it does make sense. Following that reasoning we should have:
So I still think that Otherwise evalf is wrong in all these cases and should give nan.
Do you agree? |
I do. Explicit limits can be used to obtain better results but I think that nan is often the safest choice for direct substitution. |
I have more examples.
|
I get inconsistent results with
0**I
:One way to think about this is the limit of
x**I
asx -> 0
which (for positive x) is the limit ofexp(I*log(x)) = cos(log(x)) + I*sin(log(x)
. In that case we haveabs(r)=1
andr.is_zero
is False which makes sense. Alsor.doit
should give nan since the phase is unknowable. Then we should say thatr.evalf()
is incorrect and the other results are fine.I'm sure there are other ways to think about this that lead to different conclusions though.
Taking a slightly different example:
Here we could see this as the limit of
exp((1+I)*log(x)) = x*(cos(log(x)+I*sin(log(x))
asx->0
which would be 0. Then evalf and abs are correct but is_zero and doit are wrong.Following the same reasoning as above this is the limit of
(1/x)*(cos(log(x))+I*sin(log(x)))
which should be zoo. Then doit should give zoo, abs should give oo, is_zero should be True, evalf should give ...?The text was updated successfully, but these errors were encountered: