From 01a5eea369994fa64be749069fd9f28e3bd5393b Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Tue, 19 Sep 2023 21:15:09 +0200 Subject: [PATCH] use generic zero --- src/Li.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Li.jl b/src/Li.jl index d1521ac..92afb8a 100644 --- a/src/Li.jl +++ b/src/Li.jl @@ -160,7 +160,7 @@ oddsgn(n) = isodd(n) ? 1.0 : -1.0 # # Li(n,-z) + (-1)^n Li(n,-1/z) # = -log(n,z)^n/n! + 2 sum(r=1:(n÷2), log(z)^(n-2r)/(n-2r)! Li(2r,-1)) -function li_rem(n::Integer, z::ComplexF64)::ComplexF64 +function li_rem(n::Integer, z::Complex{T})::Complex{T} where T l = clog(-z) l2 = l*l; kmax = iseven(n) ? n÷2 : (n - 1)÷2 @@ -169,7 +169,7 @@ function li_rem(n::Integer, z::ComplexF64)::ComplexF64 for k in kmax:-1:1 ifac = inv_fac(n - 2*k) - ifac == 0.0 && return 2*sum + ifac == zero(T) && return 2*sum old_sum = sum sum += neg_eta(2*k)*ifac*p p *= l2