Skip to content

Hang in exponential integral function with NaN input #483

Description

@jacksonvanover

mpmath version: 1.1.0

When the argument to the floating-point precision version of the exponential integral function is a NaN, a hang is
caused. The mp version returns NaN.

Example:

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
>>> fp.ei(np.nan)
^CTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/expintegrals.py", line 290, in ei
    return ctx._ei(z)
  File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/math2.py", line 574, in ei
    ref = ei_asymp(zref, _e1)
  File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/math2.py", line 509, in ei_asymp
    s += t
KeyboardInterrupt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions