diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 217a265..7b2ee50 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,5 +1,6 @@ name: CI on: + workflow_dispatch: push: branches: - master diff --git a/src/LambertW.jl b/src/LambertW.jl index 43c7bf6..4af2dcd 100644 --- a/src/LambertW.jl +++ b/src/LambertW.jl @@ -133,7 +133,7 @@ end # choose initial value inside correct branch for root finding function _lambertw(z::Complex{T}, k::Integer, maxits::Integer) where T<:Real one_t = one(T) - pointseven = 7//10 + pointseven = 0.7 if abs(z) <= one_t/convert(T, MathConstants.e) if z == 0 k == 0 && return _no_loop(z) diff --git a/test/runtests.jl b/test/runtests.jl index 02ce8cf..8d3d1af 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,6 +4,7 @@ using Test include("lambertw_test.jl") include("aqua_test.jl") +include("small_neg_real_test.jl") if VERSION >= v"1.7" include("jet_test.jl") diff --git a/test/small_neg_real_test.jl b/test/small_neg_real_test.jl new file mode 100644 index 0000000..0e28386 --- /dev/null +++ b/test/small_neg_real_test.jl @@ -0,0 +1,9 @@ +using LambertW + +@testset "does not error for small negative real complex" begin + try lambertw(-0.4087512737796557 + 0.038455913083347504im, 0) + @test true + catch err + @test false + end +end