Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I get mpmath to work with sage variables?

In Sage, the following code produces error messages ending with "TypeError: cannot evaluate symbolic expression numerically":

from mpmath import *
var('a')
print sqrt(a)

If I remove the line "from mpmath import *", it prints "sqrt(a)" as expected.

How can I get mpmath to work with sage variables?