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

Commit

Permalink
return one from original parent, not base ring
Browse files Browse the repository at this point in the history
  • Loading branch information
behackl committed May 7, 2016
1 parent e8adfb1 commit 2c46e08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/multi_polynomial.pyx
Expand Up @@ -1802,7 +1802,7 @@ cdef class MPolynomial(CommutativeRingElement):
u = self.base_ring()(f.unit())

if u.is_one():
ans = u
ans = self.parent().one()
else:
# try to compute a n-th root of the unit in the
# base ring. the `nth_root` method thus has to be
Expand Down
8 changes: 7 additions & 1 deletion src/sage/rings/polynomial/polynomial_element.pyx
Expand Up @@ -7827,6 +7827,12 @@ cdef class Polynomial(CommutativeAlgebraElement):
13*x - 7
sage: b^3 == a
True
TESTS::
sage: R.<x> = ZZ[]
sage: parent(R.one().nth_root(3))
Univariate Polynomial Ring in x over Integer Ring
"""
# note: this code is duplicated in
# sage.rings.polynomial.multi_polynomial.MPolynomial.nth_root
Expand All @@ -7845,7 +7851,7 @@ cdef class Polynomial(CommutativeAlgebraElement):
u = self.base_ring()(f.unit())

if u.is_one():
ans = u
ans = self.parent().one()
else:
# try to compute a n-th root of the unit in the
# base ring. the `nth_root` method thus has to be
Expand Down

0 comments on commit 2c46e08

Please sign in to comment.