[Numpy-tickets] [NumPy] #401: numpy.roots() does not return roots if they are all zero.

NumPy numpy-tickets at scipy.net
Tue Dec 12 11:08:19 CST 2006


#401: numpy.roots() does not return roots if they are all zero.
------------------------+---------------------------------------------------
 Reporter:  DaleD       |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  1.0 Release
Component:  numpy.core  |     Version:  none       
 Severity:  normal      |    Keywords:             
------------------------+---------------------------------------------------
 Python 2.4.3, Enthought Edition 1.0.0, on Windows, numpy.version.version=
 '0.9.9.2706'

 If all of the roots of a polynomial are zero, then an empty array is
 returned from roots().  Example:

 >>> from numpy import *
 >>> roots(array([1.0,0,1.0]))
 array([ 0.+1.j,  0.-1.j])      # correct
 >>> roots(array([1.0,0,0]))
 array([], dtype=int32)         # either incorrect or inconvenient
 >>> roots(array([1.0,1.0,0]))
 array([-1.,  0.])              # returns the zero root okay here
 >>>

 Should either document this behavior(yuck) or return all the zero
 roots(cool).

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/401>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list