PolynomialRoots.jl icon indicating copy to clipboard operation
PolynomialRoots.jl copied to clipboard

JET: MethodError for zero polynomial

Open fkastner opened this issue 7 months ago • 0 comments

Complaint from JET.jl:

roots(poly::Vector{Int64}) @ PolynomialRoots /src/PolynomialRoots.jl:610
roots(poly::Vector{Int64}; epsilon::Float64, polish::Bool) @ PolynomialRoots /src/PolynomialRoots.jl:617
│ no matching method found `(::Colon)(::Int64, ::Nothing)` (1/2 union split): (1 PolynomialRoots.:(:) last_nz::Union{Nothing, Int64})
└────────────────────

So Line 617 errors with a MethodError for ::Colon if the input vector has no nonzero element.

MWE:

using PolynomialRoots
roots([0,0,0])

fkastner avatar Dec 05 '23 06:12 fkastner