Skip to content

Conversation

skirpichev
Copy link
Collaborator

Closes #480
Closes #481
Closes #482
Closes #483
Closes #484
Closes #487

Copy link
Contributor

@cbm755 cbm755 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! +1 to merge

t *= k*r
s += t
if abs(t) < 1e-16:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or

diff --git a/mpmath/math2.py b/mpmath/math2.py
index 302e25f..e54c0d1 100644
--- a/mpmath/math2.py
+++ b/mpmath/math2.py
@@ -507,7 +507,7 @@ def ei_asymp(z, _e1=False):
     while 1:
         t *= k*r
         s += t
-        if abs(t) < 1e-16:
+        if not (abs(t) >= 1e-16):
             break
         k += 1
     v = s*exp(z)/z

@skirpichev skirpichev merged commit 8650604 into mpmath:master Mar 30, 2023
@skirpichev skirpichev deleted the ei_asympt-nan branch March 30, 2023 02:15
@skirpichev skirpichev added this to the 1.4 milestone May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants