Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix conversion from gap polynomial with valence > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Sep 2, 2020
1 parent c353bce commit 82191ca
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/sage/libs/gap/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,16 @@ cdef class GapElement(RingElement):
(3*x^2 + x)/(x^2 - 2)
sage: p.sage().parent()
Fraction Field of Univariate Polynomial Ring in x over Integer Ring
TESTS:
Check :trac:`30496`::
sage: x = libgap.eval('Indeterminate(Integers, "x")')
sage: p = x^2 - 2*x
sage: p.sage()
x^2 - 2*x
"""
if self.value is NULL:
return None
Expand All @@ -1373,7 +1383,8 @@ cdef class GapElement(RingElement):
if self.IsUnivariatePolynomial():
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
R = PolynomialRing(base_ring, var)
return R(num)
x = R.gen()
return x**val * R(num)

elif self.IsLaurentPolynomial():
from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
Expand Down

0 comments on commit 82191ca

Please sign in to comment.