Hi,

On Sat, May 22, 2010 at 05:38:45PM -0700, smichr wrote:
> Is there any reason not to use divmod for the case where the remainder
> is returned? This would be in keeping with the builtin python behavior
> with integers.
> 
> >>> divod(15,4)
> (3, 3)
> 

as long as you use Poly instances, you can, e.g.:

In [1]: divmod(x**2, x)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/home/matt/repo/git/sympy/<ipython console> in <module>()

TypeError: unsupported operand type(s) for divmod(): 'Pow' and 'Symbol'

In [2]: divmod(Poly(x**2), Poly(x))
Out[2]: (Poly(x, x, domain='ZZ'), Poly(0, x, domain='ZZ'))

> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> 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/sympy?hl=en.
> 

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to