8000 Propagate nan in ei_asymp() by skirpichev · Pull Request #672 · mpmath/mpmath · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Propagate nan in ei_asymp() #672

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

Merged
merged 1 commit into from
Mar 30, 2023
Merged

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
0