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

Handle NaNs and Infs in gamma_inc #380

Merged
merged 1 commit into from
Feb 7, 2022
Merged

Handle NaNs and Infs in gamma_inc #380

merged 1 commit into from
Feb 7, 2022

Conversation

andreasnoack
Copy link
Member

These came up when testing JuliaStats/StatsFuns.jl#113.

Fixes #379

@codecov
Copy link

codecov bot commented Feb 6, 2022

Codecov Report

Merging #380 (4043879) into master (51c5cd6) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
+ Coverage   92.32%   92.40%   +0.08%     
==========================================
  Files          12       12              
  Lines        2789     2793       +4     
==========================================
+ Hits         2575     2581       +6     
+ Misses        214      212       -2     
Flag Coverage Δ
unittests 92.40% <100.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
src/gamma_inc.jl 91.80% <100.00%> (+0.05%) ⬆️
src/beta_inc.jl 92.71% <0.00%> (+0.29%) ⬆️

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 51c5cd6...4043879. Read the comment docs.

src/gamma_inc.jl Outdated Show resolved Hide resolved
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. One additional suggestion would be to check the order of the branches, i.e., that e.g. gamma_inc(NaN, -1.0), gamma_inc(-1.0, NaN), and gamma_inc(1.0, -Inf) still throw an error and that gamma_inc(NaN, Inf) returns NaN.

@andreasnoack
Copy link
Member Author

Sounds good. I've added the extra tests.

@andreasnoack andreasnoack merged commit d4820bd into master Feb 7, 2022
@andreasnoack andreasnoack deleted the an/gammainc branch February 7, 2022 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gamma_inc doesn't handle NaNs
2 participants