Updates:
Labels: -NeedsReview NeedsBetterPatch
Comment #9 on issue 2084 by nicolas.pourcelot: limit(1+1/x, x, 0, dir='-')
fails
http://code.google.com/p/sympy/issues/detail?id=2084
Two comments:
1) About 1/x**(p/q) with x<0:
gruntz(1/x**Rational(3,2),x,0,dir='-')
oo*I
limit(1/x**Rational(3,2),x,0,dir='-')
oo
Gruntz is actually correct:
N(1/(-.0000001)**Rational(3,2))
31622776601.6838⋅ⅈ
In fact, there are different and incompatible definitions of x**(3/2) for
x<0.
In sympy, x**(-3/2) is defined as exp(-3/2*ln(x).
So I think we should be coherent with this.
2) If you use ex.p and ex.q, you assume that ex is Rational.
If ex is not Rational, we may return zoo ?
Something like:
def limit(e, z, z0, dir="+"):
if e.args[1] > 0:
return z0**e.args[1]
if z0 == 0:
ex = e.args[1]
if not ex:
return S.Infinity
if dir = '-':
if ex.is_Rational:
if ex.is_odd:
return -S.Infinity
elif ex.is_even:
return S.Infinity
return S.ImaginaryUnit*S.Infinity
return S.ComplexInfinity
return z0**e.args[1]
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.