[NumPy-Tickets] [NumPy] #301: Make power and divide return floats from int inputs (like true_divide)

NumPy Trac numpy-tickets@scipy....
Thu Mar 31 11:11:00 CDT 2011


#301: Make power and divide return floats from int inputs (like true_divide)
-------------------------+--------------------------------------------------
 Reporter:  stefan       |       Owner:  somebody      
     Type:  enhancement  |      Status:  needs_decision
 Priority:  normal       |   Milestone:  Unscheduled   
Component:  numpy.core   |     Version:                
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by rgommers):

 Charles just noted on the mailing list that there is also true_divide(),
 which does what I propose divide() should do. That's correct, but it's
 hard to find and the name is fairly meaningless to new users. There's no
 true_power().

 So to expand on the above, here's a more complete proposal:

   - new divide() should be current true_divide()
   - current divide should be integer_divide()
   - true_divide() can be deprecated
   - power() should return floats
   - current behavior of power() for negative ints is useless, no
 integer_power() is needed

 The current behavior is just historical baggage. Python itself has fixed
 it, Numpy should too.

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


More information about the NumPy-Tickets mailing list