-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
No labels