This repository was archived by the owner on Jan 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/sage/rings/polynomial Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -8968,21 +8968,26 @@ cdef class Polynomial(CommutativeAlgebraElement):
89688968 else :
89698969 raise NotImplementedError
89708970
8971- if is_FractionField(p.parent()):
8971+ P = parent(p)
8972+
8973+ if is_FractionField(P):
89728974 if p.denominator().is_unit():
89738975 p = p.numerator()
8976+ P = parent(p)
89748977 else :
89758978 raise TypeError (" The denominator should be a unit." )
89768979
89778980 if self .base_ring().has_coerce_map_from(p.parent()):
8978- return min (c.valuation(p) for c in self .coefficients())
8981+ return min (self .get_unsafe(k).valuation(p)
8982+ for k in range (self .degree()+ 1 )
8983+ if self .get_unsafe(k))
89798984
8980- elif self .parent() .has_coerce_map_from(p.parent() ):
8981- p = self .parent() .coerce(p)
8985+ elif self ._parent .has_coerce_map_from(P ):
8986+ p = self ._parent .coerce(p)
89828987 k = 0
89838988 while p.divides(self ):
89848989 k += 1
8985- self = self .__floordiv__ (p)
8990+ self = self ._floordiv_ (p) # same parent
89868991 return sage.rings.integer.Integer(k)
89878992
89888993 else :
You can’t perform that action at this time.
0 commit comments