giordano / PolynomialRoots.jl

Fast complex polynomial root finder, with support for arbitrary precision calculations
Other
54 stars 15 forks source link

JET: MethodError for zero polynomial #28

Open fkastner opened 11 months ago

fkastner commented 11 months ago

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])