Skip to content
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

Wrong limit result for Abs((-n/(n+1))**n) #26513

Open
satels opened this issue Apr 16, 2024 · 1 comment
Open

Wrong limit result for Abs((-n/(n+1))**n) #26513

satels opened this issue Apr 16, 2024 · 1 comment
Labels

Comments

@satels
Copy link
Contributor

satels commented Apr 16, 2024

import sympy

from sympy import S, Symbol, limit, oo

print('sympy version:', sympy.__version__)

n = Symbol('n', real=True)

expr = (n/(n+1))**n
print(limit(expr, n, oo))  # Success

expr = (-n/(n+1))**n
print(limit(expr, n, oo))  # Wrong

expr = Abs((-n/(n+1))**n)
print(limit(expr, n, oo))  # Wrong

The result:

sympy version: 1.12
exp(-1)
0
0
@satels satels changed the title Wrong limit result Wrong limit result for Abs((-n/(n+1))**n) Apr 16, 2024
@anutosh491
Copy link
Member

Thanks for raising this. We do perform poorly when it comes to limits (bi-directional, or at infinities too ... you can easily find similar errors for -oo too ) involving the abs function.

skirpichev added a commit to skirpichev/diofant that referenced this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants