[Numpy-discussion] Binary ufuncs: minimum

Christopher Barker Chris.Barker@noaa....
Tue May 27 19:08:22 CDT 2008

Charles R Harris wrote:
> I guess it 
> depends on what guarantees we want to make, which is what this is all about.

Exactly. However, while I'd like to guarantee that abs(x) >= 0, the 
truth is that numpy is "close to the metal" in a lot of ways, and anyone 
should know that the arithmetic of integers near max and minimum values 
is fraught with danger.

If we don't change the type, then any number other than MIN_INT works 
correctly. I think more code will break by silently going from a signed 
to a signed type than that one value being weird.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Numpy-discussion mailing list