Skip to content

Commit 2b04804

Browse files
committed
Add signflip from Base
1 parent 5466fb8 commit 2b04804

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gamma.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This file contains code that was formerly a part of Julia. License is MIT: http://julialang.org/license
22

3-
using Base.Math: signflip, f16, f32, f64
43
using Base.MPFR: ROUNDING_MODE, big_ln2
54

65
typealias ComplexOrReal{T} Union{T,Complex{T}}
@@ -81,6 +80,9 @@ function trigamma(z::ComplexOrReal{Float64})
8180
ψ += t*w * @evalpoly(w,0.16666666666666666,-0.03333333333333333,0.023809523809523808,-0.03333333333333333,0.07575757575757576,-0.2531135531135531,1.1666666666666667,-7.092156862745098)
8281
end
8382

83+
signflip(m::Number, z) = (-1+0im)^m * z
84+
signflip(m::Integer, z) = iseven(m) ? z : -z
85+
8486
# (-1)^m d^m/dz^m cot(z) = p_m(cot z), where p_m is a polynomial
8587
# that satisfies the recurrence p_{m+1}(x) = p_m′(x) * (1 + x^2).
8688
# Note that p_m(x) has only even powers of x if m is odd, and

0 commit comments

Comments
 (0)