Is there a way to evaluate a string in the "same way" as sage would
evaluate it?  Or, to put it another way, maybe I'm just confused about
the way 'eval' works (or maybe eval isn't the right function) ...

sage: var('frac')
frac
sage: frac=eval('x/2')
sage: frac
x/2

But ...

sage: type(frac)
<class 'sage.calculus.calculus.SymbolicArithmetic'>
sage: frac=eval('1/2')
sage: frac
0
sage: type(frac)
<type 'int'>

Thanks,

-Mike

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to