... etc. Sort of surprising that abs gives something negative. Is this
the intended behaviour as covered by a unit test and doc already?
I don't think it's specified. However
In : x = array([-128], dtype=int8)
In : -x Out: array([-128], dtype=int8)
Because that's how two's complement operates. In two's complement the positive and negative values aren't symmetric. OTOH, abs has to return a positive value. Hmm..., we could return the corresponding unsigned type in this case, but folks might not like changing the type, either.