On Sunday, December 4, 2016 at 5:58:45 PM UTC+1, Pierre wrote: > -- numpy.int32 or int.64: like "int" initially, but works mod 2^32 or > 2^64, and gives an overflow warning when it happens. No increase in > speed, for general reasons which I will just call "overhead" for lack > of a better understanding. (Still good for numpy functions, > obviously). >
Signed overflow is undefined in C/C++ and not necessarily mod 2^x. I'm pretty sure that numpy inherits this from C/C++. You must use unsigned integer types like numpy.uint64 if you rely on overflow behavior. The overhead is of course the wrapping in a Python object. If that is limiting your computation then you'll have to work in C/Cython with the internal integer (machine int or gmp/mpir). -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.