Skip to content

Commit e9f59d7

Browse files
authored
Ngcd bug nz (#334)
* fix bug from bug fix
1 parent b4d31f6 commit e9f59d7

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "Polynomials"
22
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
33
license = "MIT"
44
author = "JuliaMath"
5-
version = "2.0.7"
5+
version = "2.0.8"
66

77
[deps]
88
Intervals = "d8418881-c3e1-53bb-8760-2df7ec849ed5"

src/polynomials/multroot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ function multroot(p::Polynomials.StandardBasisPolynomial{T}; verbose=false,
8080
kwargs...) where {T}
8181

8282
# degenerate case, all zeros
83-
if findfirst(!iszero, coeffs(p)) == length(coeffs(p))
84-
return (values=zeros(T,1), multiplicities=nz, κ=NaN, ϵ=NaN)
83+
if (nz = findfirst(!iszero, coeffs(p))) == length(coeffs(p))
84+
return (values=zeros(T,1), multiplicities=[nz-1], κ=NaN, ϵ=NaN)
8585
end
8686

8787
z, l = pejorative_manifold(p; kwargs...)

test/StandardBasis.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@ end
576576
# with right manifold it does yield a small forward error
577577
zs′ = Polynomials.Multroot.pejorative_root(q, rts .+ 1e-4*rand(3), n*ls)
578578
@test prod(Polynomials.Multroot.stats(q, zs′, n*ls)) < sqrt(eps())
579+
# bug with monomial
580+
T = Float64
581+
x = variable(P{T})
582+
out = Polynomials.Multroot.multroot(x^3)
583+
@test out.values == zeros(T,1)
584+
@test out.multiplicities == [3]
579585
end
580586
end
581587
end

0 commit comments

Comments
 (0)