On Tue, Dec 28, 2021 at 2:54 PM Warren Weckesser <[email protected]>
wrote:

> On 12/28/21, Lev Maximov <[email protected]> wrote:
> > On Tue, Dec 28, 2021 at 3:43 PM Evgeni Burovski
> > <[email protected]>
> > wrote:
> >
> >> Very nice overview!
> >>
> >> One question and one suggestion:
> >>
> >> 1. Is integer wraparound guaranteed for signed ints, or is it an
> >> implementation detail? For unsigned ints, sure, it's straight from a C
> >> standard; what about signed types however.
> >>
> > Signed ints wraparound in just the same way as unsigned, both in C and in
> > NumPy. Added an illustration.
>
> Overflow of *signed* ints in the C language is *undefined behavior*.
> In practice, most compilers might do what you expect, but the
> wrap-around behavior is not guaranteed and should not be relied on.
>
> Warren
>
>
There used to be one's complement machines. I expect Numpy will break badly
if it is compiled for anything that doesn't use two's complement.

Chuck
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: [email protected]

Reply via email to