fix series expansion of abs
commit16fdc09aa7eb32633bdf74acfbb3a1065ff38a64
authorStepan Roucka <stepan@roucka.eu>
Sat, 30 Aug 2008 13:08:30 +0000 (30 15:08 +0200)
committerStepan Roucka <stepan@roucka.eu>
Sat, 30 Aug 2008 13:08:30 +0000 (30 15:08 +0200)
tree3da168c5ccd904b19f6d1e5c2a5a12a192a7e788
parent1b7efdd676e2609abed1389e4b5df38a8358b8bd
fix series expansion of abs

This improves series of abs around zero. Error term
is returned only if needed
before:
In [23]: abs(x).nseries(x,0,2)
Out[23]: x + O(x**2)
now:
In [27]: abs(x).nseries(x, 0, 2)
Out[27]: x
Expansion is now computed also for nonzero arguments of abs,
In [34]: abs(sin(x+1)+1).nseries(x,0,2)
Out[34]: 1 + x⋅cos(1) + sin(1) + O(x**2)
Now the abs(sin(x+1)) limit works
In [37]: abs(sin(x+1)).limit(x,0)
Out[37]: sin(1)

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
sympy/functions/elementary/complexes.py
sympy/series/tests/test_limits.py
sympy/series/tests/test_nseries.py