Dear All,

In my work related to the Diophantine Module for SymPy (PR 
#2168<https://github.com/sympy/sympy/pull/2168>)
I came across a situation where I want to find the degree of an expression.

I initially used max(degree_list(expr)) but it doesn't always return what I 
want.

In [7]: from sympy import degree_list
> In [8]: from sympy.abc import x, y
> In [9]: max(degree_list(5*x*y + x - 5*y + 2))
> Out[9]: 1
>

I want the answer to be two in the above case.
I found the workaround,

In [10]: from sympy import Poly
> In [11]: Poly(5*x*y + x - 5*y + 2).total_degree()
> Out[11]: 2
>

which gives me the desired result. Is there a better way to get the result
rather than converting it to Polynomial? Thanks in advance.

Regards,
Thilina

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to