Skip to content

Commit

Permalink
Fix UnivPoly adhoc subtraction
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 28, 2024
1 parent 7a77433 commit 2fc343b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/generic/UnivPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,15 @@ for op in (:+, :-, :*)
return UnivPoly{T}($op(data(p),n), S)
end

$op(n::Union{Integer, Rational, AbstractFloat}, p::UnivPoly) = $op(p,n)
function $op(n::Union{Integer, Rational, AbstractFloat}, p::UnivPoly{T}) where {T}
S = parent(p)
return UnivPoly{T}($op(n,data(p)), S)
end

$op(n::T, p::UnivPoly{T}) where {T <: RingElem} = $op(p,n)
function $op(n::T, p::UnivPoly{T}) where {T <: RingElem}
S = parent(p)
return UnivPoly{T}($op(n,data(p)), S)

Check warning on line 526 in src/generic/UnivPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/UnivPoly.jl#L524-L526

Added lines #L524 - L526 were not covered by tests
end
end
end

Expand Down

0 comments on commit 2fc343b

Please sign in to comment.