diff --git a/src/generic/LaurentMPoly.jl b/src/generic/LaurentMPoly.jl index 23297aa2dd..448a6cb21e 100644 --- a/src/generic/LaurentMPoly.jl +++ b/src/generic/LaurentMPoly.jl @@ -235,8 +235,8 @@ function evaluate(a::LaurentMPolyWrap, b::Vector) (ap, ad) = _normalize(a) z = evaluate(ap, b) for i in 1:nvars(parent(a)) - if !iszero(a.mindegs[i]) - z *= b[i]^a.mindegs[i] + if !iszero(ad[i]) + z *= b[i]^ad[i] end end return z diff --git a/test/generic/LaurentMPoly-test.jl b/test/generic/LaurentMPoly-test.jl index 03a6b8a071..3e928e1455 100644 --- a/test/generic/LaurentMPoly-test.jl +++ b/test/generic/LaurentMPoly-test.jl @@ -42,6 +42,7 @@ end @testset "Generic.LaurentMPoly.euclidean" begin L, (x, y) = LaurentPolynomialRing(ZZ, ["x", "y"]) @test isone(gcd(x, y)) + @test isone(gcd(inv(x), inv(y))) @test_throws Exception divrem(x, y) end @@ -61,6 +62,7 @@ end @test divides(a^2, a) == (true, a) @test evaluate(x^-1 + y, [QQ(2), QQ(3)]) == 1//2 + 3 + @test evaluate(inv(x)*x, [QQ(2), QQ(3)]) == 1 a = 2*x^-2*y + 3*x*y^-3 le = leading_exponent_vector(a)