# HG changeset patch # User Stepan Roucka <[EMAIL PROTECTED]> # Date 1223675613 -7200 # Node ID 885e35e7f8a2bc03ed74b9189b84055e153038a2 # Parent 8f3fbceae17d9348f66b62257e0f31e5309ea3d5 Fix broken docstrings (#1147)
The patches implementing the rules for simplifying exponentiation have broken the doctests. The problem was fixed by setting the right assumptions. In both examples expression of the form 1/(x**a) needs to be simplified to x**(-a). In the evalf example, the exponent is summation index, so it is set to integer. The together example holds only for positive x and real y. diff --git a/sympy/core/evalf.py b/sympy/core/evalf.py --- a/sympy/core/evalf.py +++ b/sympy/core/evalf.py @@ -1003,7 +1003,7 @@ def N(x, n=15, **options): Example: >>> from sympy import Sum, Symbol, oo - >>> k = Symbol("k") + >>> k = Symbol("k", integer=True) >>> Sum(1/k**k, (k, 1, oo)) Sum(k**(-k), (k, 1, oo)) >>> N(Sum(1/k**k, (k, 1, oo)), 4) diff --git a/sympy/simplify/simplify.py b/sympy/simplify/simplify.py --- a/sympy/simplify/simplify.py +++ b/sympy/simplify/simplify.py @@ -220,6 +220,8 @@ def together(expr, deep=False): It also perfect possible to work with symbolic powers or exponential functions or combinations of both: + >>> x = Symbol('x', positive=True) + >>> y = Symbol('y', real=True) >>> together(1/x**y + 1/x**(y-1)) x**(-y)*(1 + x) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-patches" group. To post to this group, send email to sympy-patches@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sympy-patches?hl=en -~----------~----~----~----~------~----~------~--~---