Skip to content

Commit ef51da6

Browse files
author
Release Manager
committed
gh-37622: Ensure the `degree()` method of `Polynomial_generic_dense_inexact` returns an `Integer` On the testing of a bunch of new hyperelliptic curve code things, I keep finding cases where the degree of polynomials is returned as an `int` instead of `Integer`. Here's another fix for the case when we have polynomials over Eisenstein extensions of p-adics. Fixes: #37621 URL: #37622 Reported by: Giacomo Pope Reviewer(s): grhkm21
2 parents e39064b + fb3e063 commit ef51da6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/sage/rings/polynomial/polynomial_element.pyx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12806,6 +12806,18 @@ cdef class Polynomial_generic_dense_inexact(Polynomial_generic_dense):
1280612806
...
1280712807
PrecisionError: the leading coefficient is indistinguishable from 0
1280812808
12809+
TESTS:
12810+
12811+
Ensure that :issue:`37621` is fixed::
12812+
12813+
sage: k.<x> = QQ[]
12814+
sage: K = Qp(11,5)
12815+
sage: L.<a> = K.extension(x^20-11)
12816+
sage: R.<x> = L[]
12817+
sage: f = R.random_element()
12818+
sage: type(f.degree())
12819+
<class 'sage.rings.integer.Integer'>
12820+
1280912821
AUTHOR:
1281012822
1281112823
- Xavier Caruso (2013-03)
@@ -12822,7 +12834,7 @@ cdef class Polynomial_generic_dense_inexact(Polynomial_generic_dense):
1282212834
d -= 1
1282312835
else:
1282412836
break
12825-
return d
12837+
return Integer(d)
1282612838

1282712839
def prec_degree(self):
1282812840
r"""

0 commit comments

Comments
 (0)