Updates:
        Status: Fixed
        Labels: -NeedsReview PassedReview

Comment #9 on issue 2031 by matt...@gmail.com: Add 'auto' flag to div(), quo() and rem()
http://code.google.com/p/sympy/issues/detail?id=2031

Now in master:

In [1]: div(x**2 + 1, 2*x - 4)
Out[1]:
⎛    x   ⎞
⎜1 + ─, 5⎟
⎝    2   ⎠

In [2]: div(x**2 + 1, 2*x - 4, auto=False)
Out[2]:
⎛        2⎞
⎝0, 1 + x ⎠

(the same applies to div() method of Poly). Note that .div() will retract the ground domain if needed and possible, e.g.:

In [3]: Poly(x**2 + 1).div(Poly(x - 4))
Out[3]: (Poly(x + 4, x, domain='ZZ'), Poly(17, x, domain='ZZ'))

(internally the division was performed over QQ). However, in the following case:

In [4]: Poly(x**2 + 1).div(Poly(2*x - 4))
Out[4]: (Poly(1/2*x + 1, x, domain='QQ'), Poly(5, x, domain='QQ'))

it was not possible to retract the quotient, so the resulting ground domain is QQ (although initially the polynomials were over ZZ, due to domain construction algorithm).

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to