[Numpy-discussion] abs for max negative integers - desired behavior?

Daniele Nicolodi daniele@grinta....
Wed Oct 12 04:28:51 CDT 2011


On 11/10/11 21:16, Charles R Harris wrote:
> IIRC, matlab was said to return
> +127 as abs(-128), which, if true, is quite curious.

I just checked and this is indeed the case in Matlab 7.10.0 R2010a:

>> abs(int8(-128))

ans =

  127

Cheers,
-- 
Daniele


More information about the NumPy-Discussion mailing list