[Numpy-discussion] Re: Managing integer overflow

2023-05-03 Thread Robert Kern
On Tue, May 2, 2023 at 8:03 AM wrote: > > I think this example shows that you don't need any special infrastructure > > from numpy. I don't think there is going to be much appetite to expand > our > > API in this direction. > > But I do! I'm looking for something that implements the > multiply_ch

[Numpy-discussion] Re: Managing integer overflow

2023-05-02 Thread Sebastian Berg
On Mon, 2023-05-01 at 17:50 +, jmsa...@gmail.com wrote: > > I think this example shows that you don't need any special > > infrastructure > > from numpy. I don't think there is going to be much appetite to > > expand our > > API in this direction. > > But I do! I'm looking for something that i

[Numpy-discussion] Re: Managing integer overflow

2023-05-02 Thread jmsachs
> I think this example shows that you don't need any special infrastructure > from numpy. I don't think there is going to be much appetite to expand our > API in this direction. But I do! I'm looking for something that implements the multiply_check_ov(X,Y) and similar functionality for addition a

[Numpy-discussion] Re: Managing integer overflow

2023-04-27 Thread Robert Kern
Two boolean arrays are not more compact than one signed `int8` array. But since you'd have to make bool masks from such an array anyways to do anything useful, you might as well pass the bool masks. I think this example shows that you don't need any special infrastructure from numpy. I don't think

[Numpy-discussion] Re: Managing integer overflow

2023-04-27 Thread jmsachs
> Ideally if there is an overflow in an array operation I'd like to produce an > "overflow array" that's the same size as the result array, but with the > values +1 if it's a positive overflow or -1 if it's a negative overflow. Alternatively, if boolean arrays are a much more compact memory foot