On Tue, Dec 28, 2021 at 2:54 PM Warren Weckesser <warren.weckes...@gmail.com>
wrote:

> On 12/28/21, Lev Maximov <lev.maxi...@gmail.com> wrote:
> > On Tue, Dec 28, 2021 at 3:43 PM Evgeni Burovski
> > <evgeny.burovs...@gmail.com>
> > 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 -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to