sage: R.<x>=QQ[]                                                      
sage: f=(x^2/x)                                                       
sage: type(f)                                                         
<type '...FractionFieldElement'>       
sage: f.monomials() # this fails because f is a fraction field element
Traceback (most recent call last)
...


sage: f=(x^2//x)  # note the //
sage: type(f)
<class '...Polynomial_rational_dense'>
sage: f.monomials() # this fails because univariate polynomials don't have a 
                                      # monomials method
---------------------------------------------------------------------------
Traceback (most recent call last)
...

sage: R.<x>=PolynomialRing(QQ,1) # constructing a multivariate ring
sage: f=(x^2//x)
sage: f.monomials() # yay!
[x]

Hope that helps,
Martin


-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [email protected]

-- 
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
URL: http://www.sagemath.org

To unsubscribe from this group, send email to 
sage-support+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to