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

binomial(x,k) for non-integer x #48124

Merged
merged 4 commits into from
Jan 24, 2023
Merged

binomial(x,k) for non-integer x #48124

merged 4 commits into from
Jan 24, 2023

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented Jan 4, 2023

It was pointed out on discourse that binomial(x, k) has a perfectly sensible and standard meaning for non-integer x and integer k, where it is simply a polynomial in x.

Since it can be implemented in only a few lines, a naive implementation overflows, and this can only be done in Base to avoid type piracy, it seems worthwhile adding.

(For non-integer k, a generalization requires the Gamma function and/or the beta function, which is out of scope for Base. See also #14165 and JuliaMath/SpecialFunctions.jl#282)

@stevengj stevengj added the maths Mathematical functions label Jan 4, 2023
@stevengj
Copy link
Member Author

stevengj commented Jan 6, 2023

CI failures seem unrelated. (It would be nice to see a green CI again someday!)

@vtjnash vtjnash requested a review from andreasnoack January 22, 2023 05:29
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Sounds sensible to me. Shall we merge this?

Copy link
Member

@andreasnoack andreasnoack left a comment

Choose a reason for hiding this comment

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

Seems like a useful and uncontroversial extension.

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Jan 22, 2023
@stevengj stevengj merged commit f9d0473 into master Jan 24, 2023
@stevengj stevengj deleted the sgj/binomial-noninteger branch January 24, 2023 15:27
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maths Mathematical functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants