Skip to content

Commit

Permalink
Fix UnivPoly adhoc subtraction (#1881)
Browse files Browse the repository at this point in the history
Co-authored-by: Max Horn <[email protected]>
  • Loading branch information
lgoettgens and fingolfin authored Oct 29, 2024
1 parent 193e1b8 commit 45bd09a
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)
end
end
end

Expand Down

0 comments on commit 45bd09a

Please sign in to comment.