File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
src/sage/rings/polynomial Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -860,13 +860,25 @@ def fraction(self):
860
860
sage: f = ex.fraction();f
861
861
-1/(t^5 - 5*t^4 + 10*t^3 - 10*t^2 + 5*t - 1)
862
862
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 )
866
866
867
867
sage: poly = ex.polynomial()
868
868
sage: [poly(i) for i in range(6)]
869
869
[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
870
882
"""
871
883
v = self .h_vector ()
872
884
d = len (v )
You can’t perform that action at this time.
0 commit comments