| 1 | initial version |
p.degrees()[-d-1] yields the exponent that belongs to a[d], even after we introduce a higher a[d]:
sage: R.<a> = InfinitePolynomialRing(QQ)
....: p = a[1]*a[2]^2
....: p.degrees()[-2-1]
2
sage: p.degrees()[-3-1]
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In [2], line 1
----> 1 p.degrees()[-Integer(3)-Integer(1)]
IndexError: tuple index out of range
sage: a[3]
a_3
sage: p.degrees()[-2-1]
2
| 2 | No.2 Revision |
p.degrees()[-d-1] yields the exponent that belongs to a[d], even after we introduce a higher a[d]:
sage: R.<a> = InfinitePolynomialRing(QQ)
....: p = a[1]*a[2]^2
....: p.degrees()[-2-1]
2
sage: p.degrees()[-3-1]
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In [2], line 1
----> 1 p.degrees()[-Integer(3)-Integer(1)]
IndexError: tuple index out of range
sage: a[3]
a_3
sage: p.degrees()[-2-1]
2
It would be nice to have 0 as the output instead of the error.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.