-
Notifications
You must be signed in to change notification settings - Fork 100
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
move [l]gamma, [l]beta and lfact from base #92
Conversation
src/gamma.jl
Outdated
@@ -539,3 +539,228 @@ function polygamma(m::Integer, z::Number) | |||
# There is nothing to fallback to, since this didn't work | |||
polygamma(m, x) | |||
end | |||
|
|||
@static if true # VERSION >= v"something" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.7.0-alpha.69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will update this tonight
src/gamma.jl
Outdated
return z | ||
end | ||
|
||
lgamma_r(x::BigFloat) = (lgamma(x), lgamma_signp[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected version of this (from JuliaLang/julia#27331):
# log of absolute value of gamma function
function lgamma_r(x::BigFloat)
z = BigFloat()
lgamma_signp = Ref{Cint}()
ccall((:mpfr_lgamma,:libmpfr), Cint, (Ref{BigFloat}, Ref{Cint}, Ref{BigFloat}, Int32), z, lgamma_signp, x, ROUNDING_MODE[])
return z, lgamma_signp[]
end
lgamma(x::BigFloat) = lgamma_r(x)[1]
Commit message: "Switch to allocating lgamma_sign on the stack, for better performance (and thread-safety)"
deprecate lfact to lfactorial
… (and thread-safety).
function gamma(x::BigFloat) | ||
isnan(x) && return x | ||
z = BigFloat() | ||
ccall((:mpfr_lgamma, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Int32), z, x, ROUNDING_MODE[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in ccall target?
`[l]gamma`, `[l]beta` and `lfact` have been moved to this module from `base` module (JuliaMath#92 ), but the docs have not been updated yet. I added their docs from [Docs for Julia v0.6.1](https://docs.julialang.org/en/v0.6.1/manual/mathematical-operations/#Special-functions-1).
* docs for `[l]gamma`, `[l]beta` and `lfact` `[l]gamma`, `[l]beta` and `lfact` have been moved to this module from `base` module (#92 ), but the docs have not been updated yet. I added their docs from [Docs for Julia v0.6.1](https://docs.julialang.org/en/v0.6.1/manual/mathematical-operations/#Special-functions-1). * Update index.md
See #27473