| 1 | initial version |
Simply pass the string to the polynomial ring you want to consider:
sage: R.<x> = PolynomialRing(QQ)
sage: R
Univariate Polynomial Ring in x over Rational Field
sage: p = R(u'x + 2')
sage: p
x + 2
sage: p.degree()
1
Note that p = R(u'x + 2') is nothing but a special case of SageMath general scheme to construct an element E from its parent P:
sage: E = P(D)
where D is some data to initialize the element.
| 2 | No.2 Revision |
Simply pass the string to the polynomial ring you want to consider:
sage: R.<x> = PolynomialRing(QQ)
sage: R
Univariate Polynomial Ring in x over Rational Field
sage: p = R(u'x + 2')
sage: p
x + 2
sage: p.degree()
1
sage: p in R
True
Note that p = R(u'x + 2') is nothing but a special case of SageMath general scheme to construct an element E from its parent P:
sage: E = P(D)
where D is some data to initialize the element. element.
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.