[NumPy-Tickets] [NumPy] #1890: piecewise throws TypeError for int input and sin

NumPy Trac numpy-tickets@scipy....
Fri Jul 1 17:53:52 CDT 2011


#1890: piecewise throws TypeError for int input and sin
--------------------+-------------------------------------------------------
 Reporter:  deil    |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  1.6.0      
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by charris):

 In fact it is documented to use the same type as x

 _The output is the same shape and type as x and is found by..._

 If you truly want integer output, then you should use
 np.sin(x).astype(x.dtype).

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1890#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list