Skip to content

Commit f588340

Browse files
committed
more doctests for fraction method
1 parent 30fd3f4 commit f588340

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/sage/rings/polynomial/integer_valued_polynomials.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,13 +860,25 @@ def fraction(self):
860860
sage: f = ex.fraction();f
861861
-1/(t^5 - 5*t^4 + 10*t^3 - 10*t^2 + 5*t - 1)
862862
863-
sage: F = QQ[['t']]
864-
sage: F(f).O(6)
865-
1 + 5*t + 15*t^2 + 35*t^3 + 70*t^4 + 126*t^5 + O(t^6)
863+
sage: F = LazyPowerSeriesRing(QQ, 't')
864+
sage: F(f)
865+
1 + 5*t + 15*t^2 + 35*t^3 + 70*t^4 + 126*t^5 + 210*t^6 + O(t^7)
866866
867867
sage: poly = ex.polynomial()
868868
sage: [poly(i) for i in range(6)]
869869
[1, 5, 15, 35, 70, 126]
870+
871+
sage: y = polygen(QQ, 'y')
872+
sage: penta = A.from_polynomial(7/2*y^2 + 7/2*y + 1)
873+
sage: penta.fraction()
874+
(-t^2 - 5*t - 1)/(t^3 - 3*t^2 + 3*t - 1)
875+
876+
TESTS::
877+
878+
sage: A.zero().fraction()
879+
0
880+
sage: A.zero().fraction().parent()
881+
Fraction Field of Univariate Polynomial Ring in t over Integer Ring
870882
"""
871883
v = self.h_vector()
872884
d = len(v)

0 commit comments

Comments
 (0)