Skip to content

Commit

Permalink
Fix bug in MPoly
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 18, 2024
1 parent 2294389 commit d3bfab4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/generic/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,8 @@ function ==(a::MPoly, n::Union{Integer, Rational, AbstractFloat})
N = size(a.exps, 1)
if n == 0
return a.length == 0
elseif a.length == 0
return iszero(base_ring(a)(n))
elseif a.length == 1
return a.coeffs[1] == n && monomial_iszero(a.exps, 1, N)
end
Expand All @@ -2076,6 +2078,8 @@ function ==(a::MPoly{T}, n::T) where {T <: RingElem}
N = size(a.exps, 1)
if n == 0
return a.length == 0
elseif a.length == 0
return iszero(base_ring(a)(n))
elseif a.length == 1
return a.coeffs[1] == n && monomial_iszero(a.exps, 1, N)
end
Expand Down

0 comments on commit d3bfab4

Please sign in to comment.