Ask Your Question

Revision history [back]

p is a symbolic expression:

sage: p.parent()
Callable function ring with argument x
sage: type(p)
<type 'sage.symbolic.expression.Expression'>

If you want an element of R, you should convert it:

sage: R(p)
0.000000000000000 + 1.12837916709551*x - 0.636619772367581*x^2 + 0.102772603301940*x^3 + 0.0191284470090363*x^4 - 0.000209194640314060*x^5 - 0.00169620593157420*x^6 - 0.000590123056121359*x^7 - 0.0000258690355130820*x^8 + 0.0000645183422026163*x^9 + 0.0000297780450524763*x^10

sage: R(p).parent()
Power Series Ring in x over Real Field with 53 bits of precision

If you want a polynomial over RR, you should do:

sage: R.<x> = PolynomialRing(RR)
sage: R(p)
0.0000297780450524763*x^10 + 0.0000645183422026163*x^9 - 0.0000258690355130820*x^8 - 0.000590123056121359*x^7 - 0.00169620593157420*x^6 - 0.000209194640314060*x^5 + 0.0191284470090363*x^4 + 0.102772603301940*x^3 - 0.636619772367581*x^2 + 1.12837916709551*x