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
BUG: Correct intermediate overflow in KS one asymptotic in SciPy.stats #17783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @aherbert, this looks great. I only have some suggestions.
Also linter is failing. You can check locally doing python dev.py lint
.
Overflow can occur for 6*n when integer n is large. Change the use of exp to expm1 when appropriate. See scipy#17775
5c445c0
to
a60cf8c
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's see if all CI is happy now. Thanks for the quick updates.
CI failure is not related (and now fixed on |
Oh just for next time, try to avoid force pushing without telling first the reviewer. GitHub is not smart enough and links from email notifications are breaking after a force push. But even if, it's simpler for reviewer to know what commit they already reviewed and follow along. |
OK. Next time I will leave the commit history and you can squash them as appropriate. |
Yes this is what we do 😃 |
Bug fix shortly after |
Overflow can occur for 6*n when integer n is large.
Change the use of exp to expm1 when appropriate.
See #17775
Reference issue
Closes gh-17775.
What does this implement/fix?
Corrects integer overflow in the c implementation when n is large by changing
6*n
to6.0*n
.Use exp or expm1 to compute the p-value choosing whichever will be smallest. The opposite p-value is computed by subtraction from 1.