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

Throw MethodError instead of StackOverflowError for gamma, loggamma, and logabsgamma #347

Merged
merged 9 commits into from
Sep 27, 2021

Conversation

devmotion
Copy link
Member

This PR ensures that MethodErrors are thrown instead of StackOverflowErrors if gamma, loggamma and logabsgamma are called with arguments for which no fallback exists. Additionally, the dispatches for gamma and logabsgamma are simplified.

It is a more general alternative to #295.

Fixes #339.
Fixes #233.

src/gamma.jl Outdated Show resolved Hide resolved
src/gamma.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #347 (6f203cf) into master (1b7a377) will increase coverage by 0.67%.
The diff coverage is 95.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
+ Coverage   92.23%   92.90%   +0.67%     
==========================================
  Files          12       12              
  Lines        2717     2706      -11     
==========================================
+ Hits         2506     2514       +8     
+ Misses        211      192      -19     
Flag Coverage Δ
unittests 92.90% <95.77%> (+0.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/SpecialFunctions.jl 100.00% <ø> (ø)
src/gamma.jl 94.82% <95.77%> (+0.26%) ⬆️
src/chainrules.jl 100.00% <0.00%> (ø)
src/gamma_inc.jl 92.79% <0.00%> (+0.16%) ⬆️
src/beta_inc.jl 91.27% <0.00%> (+2.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b7a377...6f203cf. Read the comment docs.

src/gamma.jl Show resolved Hide resolved
@stevengj stevengj merged commit 0c41812 into JuliaMath:master Sep 27, 2021
@stevengj
Copy link
Member

Thanks!

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