diff --git a/src/PolynomialRoots.jl b/src/PolynomialRoots.jl index a1e4d87..7cc6a1a 100644 --- a/src/PolynomialRoots.jl +++ b/src/PolynomialRoots.jl @@ -603,7 +603,7 @@ function roots(poly::AbstractVector{<:Number}, roots::AbstractVector{<:Number}; epsilon::AbstractFloat=NaN, polish::Bool=false) degree = length(poly) - 1 @assert degree == length(roots) "`poly' must have one element more than `roots'" - roots!(promote(float.(complex(roots)), float.(complex(poly)))..., + roots!(promote(float.(complex.(roots)), float.(complex.(poly)))..., epsilon, degree, polish) end @@ -731,13 +731,13 @@ function roots5(poly::AbstractVector{<:Number}, roots::AbstractVector{<:Number}; epsilon::AbstractFloat=NaN) @assert length(poly) == 6 "Use `roots' function for polynomials of degree != 5" @assert length(roots) == 5 "`roots' vector must have 5 elements" - return roots5!(promote(float.(complex(roots)), float.(complex(poly)))..., + return roots5!(promote(float.(complex.(roots)), float.(complex.(poly)))..., epsilon, true) end function roots5(poly::AbstractVector{N}; epsilon::AbstractFloat=NaN) where {N<:Number} @assert length(poly) == 6 "Use `roots' function for polynomials of degree != 5" - return roots5!(zeros(Complex{real(float(N))}, 5), float.(complex(poly)), + return roots5!(zeros(Complex{real(float(N))}, 5), float.(complex.(poly)), epsilon, false) end