Skip to content
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: Fix handling of powm1 overflow errors #17855

Merged
merged 2 commits into from Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion scipy/special/boost_special_functions.h
Expand Up @@ -90,7 +90,12 @@ Real powm1_wrap(Real x, Real y)
z = NAN;
} catch (const std::overflow_error& e) {
sf_error("powm1", SF_ERROR_OVERFLOW, NULL);
z = INFINITY;
if (x > 0) {
z = INFINITY;
}
else {
z = -INFINITY;
}
} catch (const std::underflow_error& e) {
sf_error("powm1", SF_ERROR_UNDERFLOW, NULL);
z = 0;
Expand Down