Skip to content

Commit ea82538

Browse files
authored
attach binomial(n::Integer, k::Integer) method to docstring (#56679)
Slight tweak to #54307: attach the `binomial(n::Integer, k::Integer)` method to the corresponding docstring, rather than the narrower `binomial(n::T, k::T) where {T<:Integer}` method.
1 parent 7df1dfa commit ea82538

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/intfuncs.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,8 @@ julia> binomial(-5, 3)
12051205
# External links
12061206
* [Binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient) on Wikipedia.
12071207
"""
1208+
binomial(n::Integer, k::Integer) = binomial(promote(n, k)...)
1209+
12081210
Base.@assume_effects :terminates_locally function binomial(n::T, k::T) where T<:Integer
12091211
n0, k0 = n, k
12101212
k < 0 && return zero(T)
@@ -1233,7 +1235,6 @@ Base.@assume_effects :terminates_locally function binomial(n::T, k::T) where T<:
12331235
end
12341236
copysign(x, sgn)
12351237
end
1236-
binomial(n::Integer, k::Integer) = binomial(promote(n, k)...)
12371238

12381239
"""
12391240
binomial(x::Number, k::Integer)

0 commit comments

Comments
 (0)