[SciPy-user] polynomial division problems

Ted Horst ted.horst at earthlink.net
Wed Dec 21 18:12:12 EST 2005


Polynomial division seems not to be working for me:

 >>> import scipy
 >>> scipy.__core_version__
'0.8.6.1693'
 >>> x2m1 = scipy.poly1d([1,0,-1])
 >>> xp1 = scipy.poly1d([1,1])
 >>> xm1 = scipy.poly1d([1,-1])
 >>> x2m1/xp1

hangs, it seems the args in polydiv are backwards, so:

 >>> xp1/x2m1
[poly1d([ 0.]), poly1d([1, 1])]

but even with args reversed, this should be poly1d([1, -1])


Hopefully this is an easy fix for somebody.

Ted




More information about the SciPy-User mailing list