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

limit of rgamma function in fp context #510

Closed
jacksonvanover opened this issue Jan 16, 2020 · 0 comments · Fixed by #710
Closed

limit of rgamma function in fp context #510

jacksonvanover opened this issue Jan 16, 2020 · 0 comments · Fixed by #710
Milestone

Comments

@jacksonvanover
Copy link

mpmath version: 1.1.0

mp.rgamma(inf) evaluates to 0, but fp.rgamma(inf) throws the exception cannot convert float infinity to integer. I mention this as a potential issue because I've observed that in other cases, limits at infinity are handled in both namespaces, eg with the altzeta function or the gammainc function.

Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpmath import *
>>> import numpy as np
>>> mp.rgamma(np.inf)
mpf('0.0')
>>> fp.rgamma(np.inf)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/mpmath/math2.py", line 235, in rgamma
    return 1./gamma(x)
  File "/usr/local/lib/python3.6/dist-packages/mpmath/math2.py", line 30, in f
    return f_real(x)
  File "/usr/local/lib/python3.6/dist-packages/mpmath/math2.py", line 199, in _gamma_real
    _intx = int(x)
OverflowError: cannot convert float infinity to integer
>>> mp.altzeta(np.inf) 
mpf('1.0')
>>> fp.altzeta(np.inf)
1.0
skirpichev added a commit to skirpichev/mpmath that referenced this issue Jun 26, 2023
@skirpichev skirpichev mentioned this issue Jun 26, 2023
@skirpichev skirpichev added this to the next-release milestone Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants