[NumPy-Tickets] [NumPy] #1172: abs does not work with -maxint

NumPy Trac numpy-tickets@scipy....
Mon Feb 28 20:19:30 CST 2011


#1172: abs does not work with -maxint
------------------------+---------------------------------------------------
 Reporter:  etu         |       Owner:  somebody      
     Type:  defect      |      Status:  needs_decision
 Priority:  normal      |   Milestone:                
Component:  numpy.core  |     Version:  1.2.1         
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by rgommers):

 I agree with Charles comment in that thread:
 {{{
 This is hardware integer math. It has it's own definition, and
 apparently abs(-128) = -128.
 }}}
 Returning 127 makes no sense, returning another dtype would be
 inconsistent. The only alternative to -128 imho is to just say the
 operation is undefined and throw an error.

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


More information about the NumPy-Tickets mailing list