Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
removed factorial
  • Loading branch information
PaulXiCao committed Jan 20, 2021
commit 6b4dfff7aca4ac061082bb70d724b1b2df7c83ff
7 changes: 0 additions & 7 deletions src/gamma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,6 @@ end

## from base/numbers.jl

# this trickery is needed while the deprecated method in Base exists
@static if !hasmethod(Base.factorial, Tuple{Number})
import Base: factorial
end
factorial(x) = Base.factorial(x) # to make SpecialFunctions.factorial work unconditionally
factorial(x::Number) = gamma(x + 1) # fallback for x not Integer

"""
logabsbinomial(n, k)

Expand Down
4 changes: 0 additions & 4 deletions test/gamma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@
@test loggamma(1.4+3.7im) ≈ -3.7094025330996841898 + 2.4568090502768651184im
@test loggamma(1.4+3.7im) ≈ log(gamma(1.4+3.7im))
@test loggamma(-4.2+0im) ≈ logabsgamma(-4.2)[1] - 5pi*im
@test SpecialFunctions.factorial(3.0) == gamma(4.0) == factorial(3)
for x in (3.2, 2+1im, 3//2, 3.2+0.1im)
@test SpecialFunctions.factorial(x) == gamma(1+x)
end
@test logfactorial(0) == logfactorial(1) == 0
@test logfactorial(2) == loggamma(3)
# Ensure that the domain of logfactorial matches that of factorial (issue #21318)
Expand Down