-
Notifications
You must be signed in to change notification settings - Fork 5
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
Consider adding some zero checks #1
Comments
Thanks for the interest, @JohannesMP. If you create a pull request, I'll happily review it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disclaimer: I'm no Mathematician; Just a random programmer that stumbled on this repo while looking for an EllipticE implementation to use with Ellipses.
I noticed that if the
m
is passed intoEllipticE
is 1, as in the case when solving for the Perimeter of an Ellipse with a SemiMinor axis of 0 (or very close to it), the function can fail to converge in time despite the result being trivial.In my implementation I added a check for the same epsilon you used to verify
an-gn
in the while loop:I'm not sure if any similar checks could be added to avoid unnecessarily iterations in cases where we know what the answer should be, or if my approach here was even valid, but it resolved an edge case for me at least.
The text was updated successfully, but these errors were encountered: