diff --git a/src/expint.jl b/src/expint.jl index 50dd6f07..a0acd81d 100644 --- a/src/expint.jl +++ b/src/expint.jl @@ -207,7 +207,7 @@ En_safe_gamma_term(ν::Integer, z::Real) = (z ≥ 0 || isodd(ν) ? 1 : -1) * exp # https://functions.wolfram.com/GammaBetaErf/ExpIntegralE/10/0005/ # returns the two terms from the above equation separately function En_cf_gamma(ν::Number, z::Number, n::Int=1000) - A, z = map(float, promote(float(1 - ν), z)) + A, z = map(float, promote(1 - ν, z)) B = oneunit(A) Bprev = zero(B) Aprev = oneunit(A) diff --git a/test/expint.jl b/test/expint.jl index afc7cd49..ea59db82 100644 --- a/test/expint.jl +++ b/test/expint.jl @@ -160,6 +160,9 @@ using Base.MathConstants end # type stability @inferred SpecialFunctions.En_cf_gamma(1, 1.0 + 2.1im, 1000) + @test SpecialFunctions.En_cf_gamma(1, 1.0 + 2.1im, 1000) isa Tuple{ComplexF64,ComplexF64,Int} + @inferred SpecialFunctions.En_cf_gamma(1, 1.0f0, 1000) + @test SpecialFunctions.En_cf_gamma(1, 1.0f0, 1000) isa Tuple{Float32,Float32,Int} end @testset "En_expand_origin" begin for (x, y) in zip(xs, ys)