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 > > >> 2. It'd be nice to explicitly stress that dtype=float corresponds to a C >> double, not a C float type. This frequently trips people trying to >> interface with C or Cython (in my experience) >> > Done, thanks! > > Best regards, > Lev > _______________________________________________ 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]
