On Tue, May 27, 2008 at 6:08 PM, Christopher Barker <[EMAIL PROTECTED]>
wrote:

> 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.
>

I disagree. By definition, abs() >= 0 always. The only time having an
unsigned return will cause problems is in the augmented assignments, and
they already cause problems by not raising errors on mixed type operations,
so let the user beware.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to