Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to "recover" real number from expression?

How do I separate a RealNumber from an Expression, once it is constructed?

sage: b = RealField(200)(5)
sage: type(b)
<type 'sage.rings.real_mpfr.RealNumber'>
sage: type((b^x).operands()[0])
<type 'sage.symbolic.expression.Expression'>