diff --git a/test/Li.jl b/test/Li.jl index 7217d8d..7ae32e1 100644 --- a/test/Li.jl +++ b/test/Li.jl @@ -63,17 +63,20 @@ end @test PolyLog.li(n, Float16(1.0)) ≈ zeta @test PolyLog.li(n, 1//1) ≈ zeta @test PolyLog.li(n, 1) ≈ zeta + @test PolyLog.li(n, BigFloat("1.0")) == PolyLog.zeta(n, BigFloat) @test PolyLog.li(n, 1.0 + 0.0im) == zeta @test PolyLog.li(n, 1.0f0 + 0.0f0im) ≈ zeta @test PolyLog.li(n, ComplexF16(1.0 + 0.0im)) ≈ zeta @test PolyLog.li(n, 1//1 + 0//1im) ≈ zeta @test PolyLog.li(n, 1 + 0im) ≈ zeta + @test PolyLog.li(n, BigFloat("1.0") + 0im) == PolyLog.zeta(n, BigFloat) end # value close to boundary between series 1 and 2 in arXiv:2010.09860 - @test PolyLog.li(-2, -0.50001) ≈ -0.074072592582716422 atol=1e-14 - @test PolyLog.reli(-2, -0.50001) ≈ -0.074072592582716422 atol=1e-14 + @test PolyLog.li(-2, -0.50001) ≈ -0.074072592582716422 atol=1e-14 + @test PolyLog.reli(-2, -0.50001) ≈ -0.074072592582716422 atol=1e-14 + @test PolyLog.li(-2, BigFloat("-0.50001")) ≈ -0.074072592582716422 atol=1e-14 @test PolyLog.reli(-2, BigFloat("-0.50001")) ≈ -0.074072592582716422 atol=1e-14 # value sensitive to proper treatment of 0.0 vs -0.0 in imag(z) @@ -86,12 +89,15 @@ end @test isinf(PolyLog.reli(10, Inf)) @test isinf(PolyLog.reli(10, BigFloat(Inf))) @test isnan(PolyLog.li(10, NaN)) + @test isnan(PolyLog.li(10, BigFloat(NaN))) @test isinf(PolyLog.li(10, Inf)) + @test isinf(PolyLog.li(10, BigFloat(Inf))) # test type stability for T in (Float16, Float32, Float64, BigFloat) for n in -10:10 for x in (NaN, Inf, -2, -1, 0, 1, 2, 3) + @test typeof(PolyLog.li(n, convert(Complex{T}, x))) == Complex{T} @test typeof(PolyLog.reli(n, convert(T, x))) == T end end