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

Add logabsgamma #112

Merged
merged 2 commits into from
May 5, 2020
Merged

Add logabsgamma #112

merged 2 commits into from
May 5, 2020

Conversation

jmkuhn
Copy link
Contributor

@jmkuhn jmkuhn commented May 4, 2020

Fixes #100 lgamma gets a deprecation warning from SpecialFunctions.

julia> using DecFP

julia> using SpecialFunctions

julia> lgamma(d64"4.0")
┌ Warning: `lgamma(x::Real)` is deprecated, use `(logabsgamma(x))[1]` instead.
│   caller = top-level scope at REPL[3]:1
└ @ Core REPL[3]:1
1.791759469228055

julia> logabsgamma(d64"4.0")
(1.791759469228055, 1)

julia> logabsgamma(d64"4.0")[1]
1.791759469228055

src/DecFP.jl Show resolved Hide resolved
src/DecFP.jl Outdated
@@ -404,7 +404,15 @@ for w in (32,64,128)
@eval Base.:-(x::$BID) = @xchk(ccall(($(bidsym(w,"negate")), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
@eval Base.round(x::$BID) = @xchk(ccall(($(bidsym(w,"nearbyint")), libbid), $BID, ($BID,Cuint,Ref{Cuint}), x, roundingmode[Threads.threadid()], RefArray(flags, Threads.threadid())), DomainError, x, mask=INVALID)

@eval SpecialFunctions.lgamma(x::$BID) = @xchk(ccall(($(bidsym(w,:lgamma)), libbid), $BID, ($BID,Cuint,Ref{Cuint}), x, roundingmode[Threads.threadid()], RefArray(flags, Threads.threadid())), DomainError, x, mask=INVALID)
@eval begin
Copy link
Member

Choose a reason for hiding this comment

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

Not clear why you need the begin block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the begin block.

@jmkuhn jmkuhn merged commit 172df41 into JuliaMath:master May 5, 2020
@jmkuhn jmkuhn deleted the lgamma branch May 5, 2020 02:17
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.

lgamma is decprecated in SpecialFunctions
2 participants