On Fri, Dec 6, 2013 at 12:23 PM, Alexander Belopolsky <ndar...@mac.com> wrote: > On Fri, Dec 6, 2013 at 11:13 AM, Alan G Isaac <alan.is...@gmail.com> wrote: > >> On 12/5/2013 11:14 PM, Alexander Belopolsky wrote: >> > did you find minus to be as useful? >> >> >> It is also a correct usage. >> > > Can you provide a reference? > > >> >> I think a good approach to this is to first realize that >> there were good reasons for the current behavior. >> > > Maybe there were, in which case the current behavior should be documented > somewhere. > > What is the rationale for this: > >>>> -array(True) + array(True) > True > > ? > > I am not aware of any algebraic system where unary minus denotes anything > other than additive inverse.
I would be perfectly happy if numpy would cast (negative) overflow to the smallest value, instead of wrapping around. The same is true for integers. >>> np.array(0, np.int8) - np.array(-128, np.int8) -128 >>> - np.array(-128, np.int8) -128 Josef <It's consistent. But does it make sense?> > > Having bools form a semiring under + and * is a fine (yet somewhat unusual) > choice, but once you've made that choice you loose subtraction because True > + x = True no longer has a unique solution. > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion