Many thanks for the 2 previous help !

About operator.add and expr.variables()...

The (real-?) last question is

a=4*x
b=4/3*x
c=4.0*x
d=4*I*x

I can get the constant by a.operands(), a.operands()[-1], but how can I 
test (without error) if this term is an integer, a rational, a float or 
a complex before next Sage improvement ?

I can force a coerce by expr._integer(), but I get an error if expr (an 
expression) isn't a integer ?
Must I define a function with a trap error ? There is also a 
_rational_() method for this retract.
I don't find the method for float and complex.

F. again...



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to